diff options
| author | Tomasz Miąsko <tomasz.miasko@gmail.com> | 2021-06-02 00:00:00 +0000 |
|---|---|---|
| committer | Tomasz Miąsko <tomasz.miasko@gmail.com> | 2021-06-02 17:09:13 +0200 |
| commit | 012c32346748f7781ff2143e9f4e53d64f2527d2 (patch) | |
| tree | 30aa89c3623279b9c66e465fa1242518b9af22ae | |
| parent | 1e13a9bb33debb931d603278b7f1a706b0d11660 (diff) | |
| download | rust-012c32346748f7781ff2143e9f4e53d64f2527d2.tar.gz rust-012c32346748f7781ff2143e9f4e53d64f2527d2.zip | |
Implement `Ty::is_enum` using `matches!`
| -rw-r--r-- | compiler/rustc_middle/src/ty/sty.rs | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/compiler/rustc_middle/src/ty/sty.rs b/compiler/rustc_middle/src/ty/sty.rs index f35ecb4d3cd..1222ed7b4d6 100644 --- a/compiler/rustc_middle/src/ty/sty.rs +++ b/compiler/rustc_middle/src/ty/sty.rs @@ -1837,10 +1837,7 @@ impl<'tcx> TyS<'tcx> { #[inline] pub fn is_enum(&self) -> bool { - match self.kind() { - Adt(adt_def, _) => adt_def.is_enum(), - _ => false, - } + matches!(self.kind(), Adt(adt_def, _) if adt_def.is_enum()) } #[inline] |
