aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_def')
-rw-r--r--crates/ra_hir_def/Cargo.toml2
-rw-r--r--crates/ra_hir_def/src/nameres.rs5
2 files changed, 5 insertions, 2 deletions
diff --git a/crates/ra_hir_def/Cargo.toml b/crates/ra_hir_def/Cargo.toml
index 30a12337e..56e791e3e 100644
--- a/crates/ra_hir_def/Cargo.toml
+++ b/crates/ra_hir_def/Cargo.toml
@@ -15,6 +15,8 @@ either = "1.5.3"
15anymap = "0.12.1" 15anymap = "0.12.1"
16drop_bomb = "0.1.4" 16drop_bomb = "0.1.4"
17 17
18stdx = { path = "../stdx" }
19
18ra_arena = { path = "../ra_arena" } 20ra_arena = { path = "../ra_arena" }
19ra_db = { path = "../ra_db" } 21ra_db = { path = "../ra_db" }
20ra_syntax = { path = "../ra_syntax" } 22ra_syntax = { path = "../ra_syntax" }
diff --git a/crates/ra_hir_def/src/nameres.rs b/crates/ra_hir_def/src/nameres.rs
index 40bdc34f5..f279c2ad4 100644
--- a/crates/ra_hir_def/src/nameres.rs
+++ b/crates/ra_hir_def/src/nameres.rs
@@ -63,6 +63,7 @@ use ra_db::{CrateId, Edition, FileId};
63use ra_prof::profile; 63use ra_prof::profile;
64use ra_syntax::ast; 64use ra_syntax::ast;
65use rustc_hash::FxHashMap; 65use rustc_hash::FxHashMap;
66use stdx::format_to;
66 67
67use crate::{ 68use crate::{
68 db::DefDatabase, 69 db::DefDatabase,
@@ -246,7 +247,7 @@ impl CrateDefMap {
246 entries.sort_by_key(|(name, _)| name.clone()); 247 entries.sort_by_key(|(name, _)| name.clone());
247 248
248 for (name, def) in entries { 249 for (name, def) in entries {
249 *buf += &format!("{}:", name); 250 format_to!(buf, "{}:", name);
250 251
251 if def.types.is_some() { 252 if def.types.is_some() {
252 *buf += " t"; 253 *buf += " t";
@@ -265,7 +266,7 @@ impl CrateDefMap {
265 } 266 }
266 267
267 for (name, child) in map.modules[module].children.iter() { 268 for (name, child) in map.modules[module].children.iter() {
268 let path = path.to_string() + &format!("::{}", name); 269 let path = &format!("{}::{}", path, name);
269 go(buf, map, &path, *child); 270 go(buf, map, &path, *child);
270 } 271 }
271 } 272 }