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 { 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 {