Implement Ty::is_enum
using matches!
This commit is contained in:
parent
1e13a9bb33
commit
012c323467
@ -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]
|
||||
|
Loading…
x
Reference in New Issue
Block a user