Skip to content

Commit

Permalink
Improve the code quality by using matches macro
Browse files Browse the repository at this point in the history
  • Loading branch information
Polkaverse committed Dec 22, 2020
1 parent d9985fc commit 57b5f8c
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions compiler/rustc_middle/src/ty/sty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 57b5f8c

Please sign in to comment.