From 3aa0e40726b44564e5f68612517d0d65d519275a Mon Sep 17 00:00:00 2001 From: Anatol Liu Date: Wed, 4 Nov 2020 20:08:46 -0800 Subject: Add static semantic token modifier for associated functions with no &self refactor logic into code_model.rs address comments --- crates/hir/src/code_model.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'crates') diff --git a/crates/hir/src/code_model.rs b/crates/hir/src/code_model.rs index 1319eb9cb..3277597c6 100644 --- a/crates/hir/src/code_model.rs +++ b/crates/hir/src/code_model.rs @@ -802,11 +802,7 @@ impl Function { .and_then(|s| s.parent()) .and_then(|s| Some(s.kind())); - match fn_parent_kind { - Some(SyntaxKind::IMPL) => true, - Some(SyntaxKind::TRAIT) => true, - _ => false, - } + matches!(fn_parent_kind, Some(SyntaxKind::IMPL) | Some(SyntaxKind::TRAIT)) } } -- cgit v1.2.3