From 5a6e770f99d1549432c1e8a1abb1aada09ad2590 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sat, 22 Feb 2020 13:15:54 +0100 Subject: Shorten some code --- crates/ra_hir_ty/src/traits/builtin.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/crates/ra_hir_ty/src/traits/builtin.rs b/crates/ra_hir_ty/src/traits/builtin.rs index df0645717..cc0f3eeb4 100644 --- a/crates/ra_hir_ty/src/traits/builtin.rs +++ b/crates/ra_hir_ty/src/traits/builtin.rs @@ -230,10 +230,7 @@ fn check_unsize_impl_prerequisites(db: &impl HirDatabase, krate: CrateId) -> boo None => return false, }; let generic_params = generics(db, unsize_trait.into()); - if generic_params.len() != 2 { - return false; - } - true + generic_params.len() == 2 } fn array_unsize_impl_datum(db: &impl HirDatabase, krate: CrateId) -> BuiltinImplData { -- cgit v1.2.3