Use a clearer match pattern (#4437)

This commit is contained in:
Leedehai 2024-07-02 10:41:41 -04:00 committed by GitHub
parent 6d835ecb92
commit aefc506424
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -120,17 +120,18 @@ 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
)
}
_ => false,
}
if self.class() == MathClass::Fence {
return true;
}
matches!(
self,
MathFragment::Frame(FrameFragment {
spaced: true,
class: MathClass::Normal | MathClass::Alphabetic,
..
})
)
}
pub fn is_text_like(&self) -> bool {