diff options
| author | PankajChaudhary5 <pankajchaudhary172@gmail.com> | 2020-12-22 20:52:38 +0530 |
|---|---|---|
| committer | PankajChaudhary5 <pankajchaudhary172@gmail.com> | 2020-12-22 20:52:38 +0530 |
| commit | 57b5f8cbb922ecb53baf5bf619a72996f8f1fb46 (patch) | |
| tree | 9b6a2af6879cfe3b6f69a96a17338dd7ed392a80 | |
| parent | d9985fc1081849532546d74c35a276694833c09d (diff) | |
| download | rust-57b5f8cbb922ecb53baf5bf619a72996f8f1fb46.tar.gz rust-57b5f8cbb922ecb53baf5bf619a72996f8f1fb46.zip | |
Improve the code quality by using matches macro
| -rw-r--r-- | compiler/rustc_middle/src/ty/sty.rs | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/compiler/rustc_middle/src/ty/sty.rs b/compiler/rustc_middle/src/ty/sty.rs index 1af56972ad0..a955cca53cc 100644 --- a/compiler/rustc_middle/src/ty/sty.rs +++ b/compiler/rustc_middle/src/ty/sty.rs @@ -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 { |
