Skip to content

Commit

Permalink
Replace trivial bool matches with the matches! macro
Browse files Browse the repository at this point in the history
  • Loading branch information
LingMan committed Oct 13, 2020
1 parent f3ab6f0 commit 7a23a71
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions compiler/rustc_ast_pretty/src/pp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 }))
}
}

Expand Down

0 comments on commit 7a23a71

Please sign in to comment.