Replace trivial bool matches with the matches! macro

This commit is contained in:
LingMan 2020-10-12 21:46:15 +02:00
parent f3ab6f0584
commit 7a23a71e51

View File

@ -170,17 +170,11 @@ pub enum Token {
impl Token { impl Token {
crate fn is_eof(&self) -> bool { crate fn is_eof(&self) -> bool {
match *self { matches!(self, Token::Eof)
Token::Eof => true,
_ => false,
}
} }
pub fn is_hardbreak_tok(&self) -> bool { pub fn is_hardbreak_tok(&self) -> bool {
match *self { matches!(self, Token::Break(BreakToken { offset: 0, blank_space: SIZE_INFINITY }))
Token::Break(BreakToken { offset: 0, blank_space: bs }) if bs == SIZE_INFINITY => true,
_ => false,
}
} }
} }