Skip to content

Commit 5af144e

Browse files
Rollup merge of #80298 - PankajChaudhary5:PankajChaudhary, r=GuillaumeGomez
Improve the code quality by using matches macro Improved the code quality by using matches macro r? `@GuillaumeGomez`
2 parents 125156c + 57b5f8c commit 5af144e

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
@@ -1572,17 +1572,11 @@ impl RegionKind {
15721572
}
15731573

15741574
pub fn is_late_bound(&self) -> bool {
1575-
match *self {
1576-
ty::ReLateBound(..) => true,
1577-
_ => false,
1578-
}
1575+
matches!(*self, ty::ReLateBound(..))
15791576
}
15801577

15811578
pub fn is_placeholder(&self) -> bool {
1582-
match *self {
1583-
ty::RePlaceholder(..) => true,
1584-
_ => false,
1585-
}
1579+
matches!(*self, ty::RePlaceholder(..))
15861580
}
15871581

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

0 commit comments

Comments
 (0)