From e75e2ae5b6b6b1364368ceb3d4081b6508b2f001 Mon Sep 17 00:00:00 2001 From: Veetaha Date: Sun, 28 Jun 2020 04:02:03 +0300 Subject: Simlify with matches!() --- crates/ra_hir_ty/src/lib.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'crates/ra_hir_ty/src/lib.rs') diff --git a/crates/ra_hir_ty/src/lib.rs b/crates/ra_hir_ty/src/lib.rs index 414158139..c9513b752 100644 --- a/crates/ra_hir_ty/src/lib.rs +++ b/crates/ra_hir_ty/src/lib.rs @@ -620,17 +620,11 @@ pub enum GenericPredicate { impl GenericPredicate { pub fn is_error(&self) -> bool { - match self { - GenericPredicate::Error => true, - _ => false, - } + matches!(self, GenericPredicate::Error) } pub fn is_implemented(&self) -> bool { - match self { - GenericPredicate::Implemented(_) => true, - _ => false, - } + matches!(self, GenericPredicate::Implemented(_)) } pub fn trait_ref(&self, db: &dyn HirDatabase) -> Option { -- cgit v1.2.3