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,18 +120,19 @@ impl MathFragment {
|
||||
}
|
||||
|
||||
pub fn is_spaced(&self) -> bool {
|
||||
self.class() == MathClass::Fence
|
||||
|| match self {
|
||||
MathFragment::Frame(frame) => {
|
||||
frame.spaced
|
||||
&& matches!(
|
||||
frame.class,
|
||||
MathClass::Normal | MathClass::Alphabetic
|
||||
if self.class() == MathClass::Fence {
|
||||
return true;
|
||||
}
|
||||
|
||||
matches!(
|
||||
self,
|
||||
MathFragment::Frame(FrameFragment {
|
||||
spaced: true,
|
||||
class: MathClass::Normal | MathClass::Alphabetic,
|
||||
..
|
||||
})
|
||||
)
|
||||
}
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn is_text_like(&self) -> bool {
|
||||
match self {
|
||||
|
Loading…
x
Reference in New Issue
Block a user