From a1d9e453b9a273db44250baa5f2dc4f261617415 Mon Sep 17 00:00:00 2001 From: Max Heller Date: Tue, 8 Aug 2023 11:06:54 -0400 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Lukas Wirth --- crates/ide-completion/src/context.rs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/crates/ide-completion/src/context.rs b/crates/ide-completion/src/context.rs index 5537673d1ee..90ad2ecaf91 100644 --- a/crates/ide-completion/src/context.rs +++ b/crates/ide-completion/src/context.rs @@ -169,19 +169,15 @@ pub(crate) enum TypeLocation { impl TypeLocation { pub(crate) fn complete_lifetimes(&self) -> bool { - match self { - TypeLocation::GenericArg(Some((_, _, Some(param)))) => { - matches!(param, ast::GenericParam::LifetimeParam(_)) - } - _ => false, - } + matches!( + self, + TypeLocation::GenericArg(Some((_, _, Some(ast::GenericParam::LifetimeParam(_))))) + ) } pub(crate) fn complete_consts(&self) -> bool { match self { - TypeLocation::GenericArg(Some((_, _, Some(param)))) => { - matches!(param, ast::GenericParam::ConstParam(_)) - } + TypeLocation::GenericArg(Some((_, _, Some(ast::GenericParam::ConstParam(_))))) => true, TypeLocation::AssocConstEq => true, _ => false, }