Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Replace trivial bool matches with the matches! macro
  • Loading branch information
LingMan committed Oct 13, 2020
commit 7a23a71e5138531f784ca4118e5136b6664bad55
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