diff options
Diffstat (limited to 'crates/ra_ide_api/src')
-rw-r--r-- | crates/ra_ide_api/src/display/structure.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_ide_api/src/display/structure.rs b/crates/ra_ide_api/src/display/structure.rs index 2e183d2f6..0b1a8b6e6 100644 --- a/crates/ra_ide_api/src/display/structure.rs +++ b/crates/ra_ide_api/src/display/structure.rs | |||
@@ -83,12 +83,12 @@ fn structure_node(node: &SyntaxNode) -> Option<StructureNode> { | |||
83 | 83 | ||
84 | fn collapse_ws(node: &SyntaxNode, output: &mut String) { | 84 | fn collapse_ws(node: &SyntaxNode, output: &mut String) { |
85 | let mut can_insert_ws = false; | 85 | let mut can_insert_ws = false; |
86 | for chunk in node.text().chunks() { | 86 | node.text().for_each_chunk(|chunk| { |
87 | for line in chunk.lines() { | 87 | for line in chunk.lines() { |
88 | let line = line.trim(); | 88 | let line = line.trim(); |
89 | if line.is_empty() { | 89 | if line.is_empty() { |
90 | if can_insert_ws { | 90 | if can_insert_ws { |
91 | output.push_str(" "); | 91 | output.push(' '); |
92 | can_insert_ws = false; | 92 | can_insert_ws = false; |
93 | } | 93 | } |
94 | } else { | 94 | } else { |
@@ -96,7 +96,7 @@ fn structure_node(node: &SyntaxNode) -> Option<StructureNode> { | |||
96 | can_insert_ws = true; | 96 | can_insert_ws = true; |
97 | } | 97 | } |
98 | } | 98 | } |
99 | } | 99 | }) |
100 | } | 100 | } |
101 | 101 | ||
102 | visitor() | 102 | visitor() |