aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/nameres
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src/nameres')
-rw-r--r--crates/ra_hir/src/nameres/collector.rs14
1 files changed, 5 insertions, 9 deletions
diff --git a/crates/ra_hir/src/nameres/collector.rs b/crates/ra_hir/src/nameres/collector.rs
index 2b07ebf4a..d66be34db 100644
--- a/crates/ra_hir/src/nameres/collector.rs
+++ b/crates/ra_hir/src/nameres/collector.rs
@@ -227,10 +227,8 @@ where
227 .items 227 .items
228 .iter() 228 .iter()
229 .map(|(name, res)| (name.clone(), Either::A(res.clone()))); 229 .map(|(name, res)| (name.clone(), Either::A(res.clone())));
230 let macros = scope 230 let macros =
231 .macros 231 scope.macros.iter().map(|(name, res)| (name.clone(), Either::B(*res)));
232 .iter()
233 .map(|(name, res)| (name.clone(), Either::B(res.clone())));
234 232
235 let all = items.chain(macros).collect::<Vec<_>>(); 233 let all = items.chain(macros).collect::<Vec<_>>();
236 self.update(module_id, Some(import_id), &all); 234 self.update(module_id, Some(import_id), &all);
@@ -243,10 +241,8 @@ where
243 .items 241 .items
244 .iter() 242 .iter()
245 .map(|(name, res)| (name.clone(), Either::A(res.clone()))); 243 .map(|(name, res)| (name.clone(), Either::A(res.clone())));
246 let macros = scope 244 let macros =
247 .macros 245 scope.macros.iter().map(|(name, res)| (name.clone(), Either::B(*res)));
248 .iter()
249 .map(|(name, res)| (name.clone(), Either::B(res.clone())));
250 246
251 let all = items.chain(macros).collect::<Vec<_>>(); 247 let all = items.chain(macros).collect::<Vec<_>>();
252 248
@@ -651,7 +647,7 @@ fn resolve_submodule(
651 candidates.push(file_dir_mod.clone()); 647 candidates.push(file_dir_mod.clone());
652 }; 648 };
653 let sr = db.source_root(source_root_id); 649 let sr = db.source_root(source_root_id);
654 let mut points_to = candidates.into_iter().filter_map(|path| sr.files.get(&path)).map(|&it| it); 650 let mut points_to = candidates.into_iter().filter_map(|path| sr.files.get(&path)).copied();
655 // FIXME: handle ambiguity 651 // FIXME: handle ambiguity
656 match points_to.next() { 652 match points_to.next() {
657 Some(file_id) => Ok(file_id), 653 Some(file_id) => Ok(file_id),