aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/nameres.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src/nameres.rs')
-rw-r--r--crates/ra_hir/src/nameres.rs9
1 files changed, 2 insertions, 7 deletions
diff --git a/crates/ra_hir/src/nameres.rs b/crates/ra_hir/src/nameres.rs
index 639726b5e..028c1882f 100644
--- a/crates/ra_hir/src/nameres.rs
+++ b/crates/ra_hir/src/nameres.rs
@@ -397,13 +397,8 @@ impl ItemMap {
397 ModuleDef::Enum(e) => { 397 ModuleDef::Enum(e) => {
398 // enum variant 398 // enum variant
399 tested_by!(item_map_enum_importing); 399 tested_by!(item_map_enum_importing);
400 let matching_variant = e 400 match e.variant(db, &segment.name) {
401 .variants(db) 401 Some(variant) => PerNs::both(variant.into(), (*e).into()),
402 .into_iter()
403 .find(|(n, _variant)| n == &segment.name);
404
405 match matching_variant {
406 Some((_n, variant)) => PerNs::both(variant.into(), (*e).into()),
407 None => PerNs::none(), 402 None => PerNs::none(),
408 } 403 }
409 } 404 }