Skip to content

Commit 57b5f8c

Browse files
committed
Improve the code quality by using matches macro
1 parent d9985fc commit 57b5f8c

File tree

1 file changed

+2
-8
lines changed
  • compiler/rustc_middle/src/ty

1 file changed

+2
-8
lines changed

compiler/rustc_middle/src/ty/sty.rs

+2-8
Original file line numberDiff line numberDiff line change
@@ -1628,17 +1628,11 @@ impl RegionKind {
16281628
}
16291629

16301630
pub fn is_late_bound(&self) -> bool {
1631-
match *self {
1632-
ty::ReLateBound(..) => true,
1633-
_ => false,
1634-
}
1631+
matches!(*self, ty::ReLateBound(..))
16351632
}
16361633

16371634
pub fn is_placeholder(&self) -> bool {
1638-
match *self {
1639-
ty::RePlaceholder(..) => true,
1640-
_ => false,
1641-
}
1635+
matches!(*self, ty::RePlaceholder(..))
16421636
}
16431637

16441638
pub fn bound_at_or_above_binder(&self, index: DebruijnIndex) -> bool {

0 commit comments

Comments
 (0)