From 57b5f8cbb922ecb53baf5bf619a72996f8f1fb46 Mon Sep 17 00:00:00 2001 From: PankajChaudhary5 Date: Tue, 22 Dec 2020 20:52:38 +0530 Subject: [PATCH] Improve the code quality by using matches macro --- compiler/rustc_middle/src/ty/sty.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/compiler/rustc_middle/src/ty/sty.rs b/compiler/rustc_middle/src/ty/sty.rs index 1af56972ad083..a955cca53cc8b 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 {