From f8bf94a4b94074eb344e495dfb4dab4bec6bc20e Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Fri, 8 May 2020 19:30:02 +0200 Subject: Use matches! --- crates/ra_hir_ty/src/lib.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'crates') diff --git a/crates/ra_hir_ty/src/lib.rs b/crates/ra_hir_ty/src/lib.rs index ac0ef1bfe..3e5f38d0d 100644 --- a/crates/ra_hir_ty/src/lib.rs +++ b/crates/ra_hir_ty/src/lib.rs @@ -731,10 +731,7 @@ impl Ty { } pub fn is_never(&self) -> bool { - match self { - Ty::Apply(ApplicationTy { ctor: TypeCtor::Never, .. }) => true, - _ => false, - } + matches!(self, Ty::Apply(ApplicationTy { ctor: TypeCtor::Never, .. })) } /// If this is a `dyn Trait` type, this returns the `Trait` part. -- cgit v1.2.3