aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorPaul Daniel Faria <[email protected]>2020-06-27 03:51:13 +0100
committerPaul Daniel Faria <[email protected]>2020-06-27 03:51:13 +0100
commit1f5d30ff1662eb94839bd1cf2e0cb57cc6fac4e4 (patch)
tree24626ba0730b35a7515251ef094e3e4cb25bf5dd /crates
parentb700443e781b8b54f88177247ceefcc03155b440 (diff)
Replace simple is_named with matches macro
Diffstat (limited to 'crates')
-rw-r--r--crates/ra_hir_def/src/item_scope.rs11
1 files changed, 1 insertions, 10 deletions
diff --git a/crates/ra_hir_def/src/item_scope.rs b/crates/ra_hir_def/src/item_scope.rs
index d0923df6d..4d446c707 100644
--- a/crates/ra_hir_def/src/item_scope.rs
+++ b/crates/ra_hir_def/src/item_scope.rs
@@ -18,15 +18,6 @@ pub(crate) enum ImportType {
18 Named, 18 Named,
19} 19}
20 20
21impl ImportType {
22 fn is_named(&self) -> bool {
23 match self {
24 ImportType::Glob => false,
25 ImportType::Named => true,
26 }
27 }
28}
29
30#[derive(Debug, Default)] 21#[derive(Debug, Default)]
31pub struct PerNsGlobImports { 22pub struct PerNsGlobImports {
32 types: FxHashSet<(LocalModuleId, Name)>, 23 types: FxHashSet<(LocalModuleId, Name)>,
@@ -200,7 +191,7 @@ impl ItemScope {
200 } 191 }
201 (Some(_), Some(_)) 192 (Some(_), Some(_))
202 if $glob_imports.$field.contains(&$lookup) 193 if $glob_imports.$field.contains(&$lookup)
203 && $def_import_type.is_named() => 194 && matches!($def_import_type, ImportType::Named) =>
204 { 195 {
205 mark::hit!(import_shadowed); 196 mark::hit!(import_shadowed);
206 $glob_imports.$field.remove(&$lookup); 197 $glob_imports.$field.remove(&$lookup);