diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2020-09-18 19:11:06 +0200 |
|---|---|---|
| committer | Matthias Krüger <matthias.krueger@famsik.de> | 2020-09-18 20:28:35 +0200 |
| commit | 40dddd33059344b546a11f150c0ec63e797f021c (patch) | |
| tree | 309de3a572ac13deab5afa9b4a1ff39726b75901 /compiler/rustc_attr | |
| parent | 2c69266c0697b0c0b34abea62cba1a1d3c59c90c (diff) | |
use matches!() macro for simple if let conditions
Diffstat (limited to 'compiler/rustc_attr')
| -rw-r--r-- | compiler/rustc_attr/src/builtin.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_attr/src/builtin.rs b/compiler/rustc_attr/src/builtin.rs index b8929fe0889..9951c252001 100644 --- a/compiler/rustc_attr/src/builtin.rs +++ b/compiler/rustc_attr/src/builtin.rs @@ -160,10 +160,10 @@ pub enum StabilityLevel { impl StabilityLevel { pub fn is_unstable(&self) -> bool { - if let StabilityLevel::Unstable { .. } = *self { true } else { false } + matches!(self, StabilityLevel::Unstable { .. }) } pub fn is_stable(&self) -> bool { - if let StabilityLevel::Stable { .. } = *self { true } else { false } + matches!(self, StabilityLevel::Stable { .. }) } } |
