diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-03-28 11:28:31 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-03-28 11:28:31 +0000 |
commit | c30425dc96895117b644f29b758cee9dac36839b (patch) | |
tree | d3ccef4aa8f681cc9de29f0435ad20e87911a6ba /crates/ra_hir_def/src/nameres.rs | |
parent | a1fea0d34ee8f3436aefd87d4c133a7ff50ffbb0 (diff) | |
parent | 311cbbdad599d51c6f08f7dd72c299f7c0128bb2 (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.rs | 5 |
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}; | |||
63 | use ra_prof::profile; | 63 | use ra_prof::profile; |
64 | use ra_syntax::ast; | 64 | use ra_syntax::ast; |
65 | use rustc_hash::FxHashMap; | 65 | use rustc_hash::FxHashMap; |
66 | use stdx::format_to; | ||
66 | 67 | ||
67 | use crate::{ | 68 | use 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 | } |