Improve the code quality by using matches macro

This commit is contained in:
PankajChaudhary5 2020-12-22 20:52:38 +05:30
parent d9985fc108
commit 57b5f8cbb9

View File

@ -1628,17 +1628,11 @@ impl RegionKind {
}
pub fn is_late_bound(&self) -> bool {
match *self {
ty::ReLateBound(..) => true,
_ => false,
}
matches!(*self, ty::ReLateBound(..))
}
pub fn is_placeholder(&self) -> bool {
match *self {
ty::RePlaceholder(..) => true,
_ => false,
}
matches!(*self, ty::RePlaceholder(..))
}
pub fn bound_at_or_above_binder(&self, index: DebruijnIndex) -> bool {