aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def/src/nameres.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-03-28 11:28:31 +0000
committerGitHub <[email protected]>2020-03-28 11:28:31 +0000
commitc30425dc96895117b644f29b758cee9dac36839b (patch)
treed3ccef4aa8f681cc9de29f0435ad20e87911a6ba /crates/ra_hir_def/src/nameres.rs
parenta1fea0d34ee8f3436aefd87d4c133a7ff50ffbb0 (diff)
parent311cbbdad599d51c6f08f7dd72c299f7c0128bb2 (diff)
Merge #3753
3753: Introduce stdx crate r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir_def/src/nameres.rs')
-rw-r--r--crates/ra_hir_def/src/nameres.rs5
1 files changed, 3 insertions, 2 deletions
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 }