diff options
| author | LingMan <LingMan@users.noreply.github.com> | 2020-10-12 21:46:15 +0200 |
|---|---|---|
| committer | LingMan <LingMan@users.noreply.github.com> | 2020-10-13 21:29:38 +0200 |
| commit | 7a23a71e5138531f784ca4118e5136b6664bad55 (patch) | |
| tree | 01af6ecb6a21ac698f912e7494d0485083098411 | |
| parent | f3ab6f05846951bed41d4b0661ac0735aebf3687 (diff) | |
| download | rust-7a23a71e5138531f784ca4118e5136b6664bad55.tar.gz rust-7a23a71e5138531f784ca4118e5136b6664bad55.zip | |
Replace trivial bool matches with the `matches!` macro
| -rw-r--r-- | compiler/rustc_ast_pretty/src/pp.rs | 10 |
1 files changed, 2 insertions, 8 deletions
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 })) } } |
