Skip to content

Commit 7a23a71

Browse files
committed
Replace trivial bool matches with the matches! macro
1 parent f3ab6f0 commit 7a23a71

File tree

1 file changed

+2
-8
lines changed
  • compiler/rustc_ast_pretty/src

1 file changed

+2
-8
lines changed

compiler/rustc_ast_pretty/src/pp.rs

+2-8
Original file line numberDiff line numberDiff line change
@@ -170,17 +170,11 @@ pub enum Token {
170170

171171
impl Token {
172172
crate fn is_eof(&self) -> bool {
173-
match *self {
174-
Token::Eof => true,
175-
_ => false,
176-
}
173+
matches!(self, Token::Eof)
177174
}
178175

179176
pub fn is_hardbreak_tok(&self) -> bool {
180-
match *self {
181-
Token::Break(BreakToken { offset: 0, blank_space: bs }) if bs == SIZE_INFINITY => true,
182-
_ => false,
183-
}
177+
matches!(self, Token::Break(BreakToken { offset: 0, blank_space: SIZE_INFINITY }))
184178
}
185179
}
186180

0 commit comments

Comments
 (0)