aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorAdnoC <[email protected]>2020-12-31 20:46:13 +0000
committerAdnoC <[email protected]>2020-12-31 20:46:13 +0000
commitcca0dfa79ed968d41464eb7beb7aaa970e2d429f (patch)
tree14f5a4529f75b9d13d5248ff8e0612b695ef6f31 /crates
parent435c189c803486a30d3fa0cdcc354e04b9993310 (diff)
we can have one less call to name.clone()
Diffstat (limited to 'crates')
-rw-r--r--crates/hir_def/src/resolver.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/hir_def/src/resolver.rs b/crates/hir_def/src/resolver.rs
index cc66dcf31..779754ada 100644
--- a/crates/hir_def/src/resolver.rs
+++ b/crates/hir_def/src/resolver.rs
@@ -510,8 +510,9 @@ impl Scope {
510 if let Some(prelude) = m.crate_def_map.prelude { 510 if let Some(prelude) = m.crate_def_map.prelude {
511 let prelude_def_map = db.crate_def_map(prelude.krate); 511 let prelude_def_map = db.crate_def_map(prelude.krate);
512 prelude_def_map[prelude.local_id].scope.entries().for_each(|(name, def)| { 512 prelude_def_map[prelude.local_id].scope.entries().for_each(|(name, def)| {
513 if !seen.contains(&(name.clone(), def)) { 513 let seen_tuple = (name.clone(), def);
514 f(name.clone(), ScopeDef::PerNs(def)); 514 if !seen.contains(&seen_tuple) {
515 f(seen_tuple.0, ScopeDef::PerNs(def));
515 } 516 }
516 }); 517 });
517 } 518 }