From cca0dfa79ed968d41464eb7beb7aaa970e2d429f Mon Sep 17 00:00:00 2001 From: AdnoC Date: Thu, 31 Dec 2020 13:46:13 -0700 Subject: we can have one less call to name.clone() --- crates/hir_def/src/resolver.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'crates') 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 { if let Some(prelude) = m.crate_def_map.prelude { let prelude_def_map = db.crate_def_map(prelude.krate); prelude_def_map[prelude.local_id].scope.entries().for_each(|(name, def)| { - if !seen.contains(&(name.clone(), def)) { - f(name.clone(), ScopeDef::PerNs(def)); + let seen_tuple = (name.clone(), def); + if !seen.contains(&seen_tuple) { + f(seen_tuple.0, ScopeDef::PerNs(def)); } }); } -- cgit v1.2.3