We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Ty::is_enum
matches!
1 parent 1e13a9b commit 012c323Copy full SHA for 012c323
1 file changed
compiler/rustc_middle/src/ty/sty.rs
@@ -1837,10 +1837,7 @@ impl<'tcx> TyS<'tcx> {
1837
1838
#[inline]
1839
pub fn is_enum(&self) -> bool {
1840
- match self.kind() {
1841
- Adt(adt_def, _) => adt_def.is_enum(),
1842
- _ => false,
1843
- }
+ matches!(self.kind(), Adt(adt_def, _) if adt_def.is_enum())
1844
}
1845
1846
0 commit comments