mirror of
https://github.com/typst/typst
synced 2025-05-17 02:25:27 +08:00
Use a clearer match pattern (#4437)
This commit is contained in:
parent
6d835ecb92
commit
aefc506424
@ -120,17 +120,18 @@ impl MathFragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn is_spaced(&self) -> bool {
|
pub fn is_spaced(&self) -> bool {
|
||||||
self.class() == MathClass::Fence
|
if self.class() == MathClass::Fence {
|
||||||
|| match self {
|
return true;
|
||||||
MathFragment::Frame(frame) => {
|
}
|
||||||
frame.spaced
|
|
||||||
&& matches!(
|
matches!(
|
||||||
frame.class,
|
self,
|
||||||
MathClass::Normal | MathClass::Alphabetic
|
MathFragment::Frame(FrameFragment {
|
||||||
)
|
spaced: true,
|
||||||
}
|
class: MathClass::Normal | MathClass::Alphabetic,
|
||||||
_ => false,
|
..
|
||||||
}
|
})
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn is_text_like(&self) -> bool {
|
pub fn is_text_like(&self) -> bool {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user