Skip to content

Commit 012c323

Browse files
committed
Implement Ty::is_enum using matches!
1 parent 1e13a9b commit 012c323

File tree

1 file changed

+1
-4
lines changed
  • compiler/rustc_middle/src/ty

1 file changed

+1
-4
lines changed

compiler/rustc_middle/src/ty/sty.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1837,10 +1837,7 @@ impl<'tcx> TyS<'tcx> {
18371837

18381838
#[inline]
18391839
pub fn is_enum(&self) -> bool {
1840-
match self.kind() {
1841-
Adt(adt_def, _) => adt_def.is_enum(),
1842-
_ => false,
1843-
}
1840+
matches!(self.kind(), Adt(adt_def, _) if adt_def.is_enum())
18441841
}
18451842

18461843
#[inline]

0 commit comments

Comments
 (0)