From 8467ba8cdb565d865e14e2115cde98cd7692719d Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 19 Jul 2019 20:29:59 +0300 Subject: flip syntax text to use internal iteration --- crates/ra_hir/src/ids.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'crates/ra_hir/src') 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 { pub fn debug_dump(self, db: &impl AstDatabase) -> String { let loc = self.loc(db); let node = loc.ast_id.to_node(db); - let syntax_str = node.syntax().text().chunks().collect::>().join(" "); + let syntax_str = { + let mut res = String::new(); + node.syntax().text().for_each_chunk(|chunk| { + if !res.is_empty() { + res.push(' ') + } + res.push_str(chunk) + }); + res + }; // dump the file name let file_id: HirFileId = self.loc(db).ast_id.file_id(); -- cgit v1.2.3