aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-07-19 18:29:59 +0100
committerAleksey Kladov <[email protected]>2019-07-19 18:29:59 +0100
commit8467ba8cdb565d865e14e2115cde98cd7692719d (patch)
tree0a38aeef5b06d7f05186e6927a4dd1280fd35396 /crates/ra_hir/src
parent8f032d6a585d59a9d2e57beeaca903a4fb5eb57b (diff)
flip syntax text to use internal iteration
Diffstat (limited to 'crates/ra_hir/src')
-rw-r--r--crates/ra_hir/src/ids.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/crates/ra_hir/src/ids.rs b/crates/ra_hir/src/ids.rs
index 05a18eb56..ec756f2c3 100644
--- a/crates/ra_hir/src/ids.rs
+++ b/crates/ra_hir/src/ids.rs
@@ -362,7 +362,16 @@ impl MacroCallId {
362 pub fn debug_dump(self, db: &impl AstDatabase) -> String { 362 pub fn debug_dump(self, db: &impl AstDatabase) -> String {
363 let loc = self.loc(db); 363 let loc = self.loc(db);
364 let node = loc.ast_id.to_node(db); 364 let node = loc.ast_id.to_node(db);
365 let syntax_str = node.syntax().text().chunks().collect::<Vec<_>>().join(" "); 365 let syntax_str = {
366 let mut res = String::new();
367 node.syntax().text().for_each_chunk(|chunk| {
368 if !res.is_empty() {
369 res.push(' ')
370 }
371 res.push_str(chunk)
372 });
373 res
374 };
366 375
367 // dump the file name 376 // dump the file name
368 let file_id: HirFileId = self.loc(db).ast_id.file_id(); 377 let file_id: HirFileId = self.loc(db).ast_id.file_id();