aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/lang_item.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src/lang_item.rs')
-rw-r--r--crates/ra_hir/src/lang_item.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_hir/src/lang_item.rs b/crates/ra_hir/src/lang_item.rs
index f9fe47b0f..0443d4d9a 100644
--- a/crates/ra_hir/src/lang_item.rs
+++ b/crates/ra_hir/src/lang_item.rs
@@ -122,7 +122,7 @@ impl LangItems {
122 module: Module, 122 module: Module,
123 ) { 123 ) {
124 if let Some(module_lang_items) = db.module_lang_items(module) { 124 if let Some(module_lang_items) = db.module_lang_items(module) {
125 self.items.extend(module_lang_items.items.iter().map(|(k, v)| (k.clone(), v.clone()))) 125 self.items.extend(module_lang_items.items.iter().map(|(k, v)| (k.clone(), *v)))
126 } 126 }
127 127
128 // Look for lang items in the children 128 // Look for lang items in the children
@@ -142,7 +142,7 @@ impl LangItems {
142 { 142 {
143 let node = item.source(db).ast; 143 let node = item.source(db).ast;
144 if let Some(lang_item_name) = lang_item_name(&*node) { 144 if let Some(lang_item_name) = lang_item_name(&*node) {
145 self.items.entry(lang_item_name).or_insert(constructor(item)); 145 self.items.entry(lang_item_name).or_insert_with(|| constructor(item));
146 } 146 }
147 } 147 }
148} 148}