diff --git a/compiler/rustc_ast_pretty/src/pp.rs b/compiler/rustc_ast_pretty/src/pp.rs index ca7f127ced6..d4718339ffe 100644 --- a/compiler/rustc_ast_pretty/src/pp.rs +++ b/compiler/rustc_ast_pretty/src/pp.rs @@ -170,17 +170,11 @@ pub enum Token { impl Token { crate fn is_eof(&self) -> bool { - match *self { - Token::Eof => true, - _ => false, - } + matches!(self, Token::Eof) } pub fn is_hardbreak_tok(&self) -> bool { - match *self { - Token::Break(BreakToken { offset: 0, blank_space: bs }) if bs == SIZE_INFINITY => true, - _ => false, - } + matches!(self, Token::Break(BreakToken { offset: 0, blank_space: SIZE_INFINITY })) } }