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 | |
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')
-rw-r--r-- | crates/ra_hir_def/Cargo.toml | 2 | ||||
-rw-r--r-- | crates/ra_hir_def/src/nameres.rs | 5 |
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" | |||
15 | anymap = "0.12.1" | 15 | anymap = "0.12.1" |
16 | drop_bomb = "0.1.4" | 16 | drop_bomb = "0.1.4" |
17 | 17 | ||
18 | stdx = { path = "../stdx" } | ||
19 | |||
18 | ra_arena = { path = "../ra_arena" } | 20 | ra_arena = { path = "../ra_arena" } |
19 | ra_db = { path = "../ra_db" } | 21 | ra_db = { path = "../ra_db" } |
20 | ra_syntax = { path = "../ra_syntax" } | 22 | ra_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}; | |||
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 | } |