diff options
Diffstat (limited to 'crates/ra_ide/src/folding_ranges.rs')
-rw-r--r-- | crates/ra_ide/src/folding_ranges.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/crates/ra_ide/src/folding_ranges.rs b/crates/ra_ide/src/folding_ranges.rs index 4eeb76d14..4379005aa 100644 --- a/crates/ra_ide/src/folding_ranges.rs +++ b/crates/ra_ide/src/folding_ranges.rs | |||
@@ -141,7 +141,7 @@ fn contiguous_range_for_group_unless( | |||
141 | } | 141 | } |
142 | 142 | ||
143 | if first != &last { | 143 | if first != &last { |
144 | Some(TextRange::from_to(first.text_range().start(), last.text_range().end())) | 144 | Some(TextRange::new(first.text_range().start(), last.text_range().end())) |
145 | } else { | 145 | } else { |
146 | // The group consists of only one element, therefore it cannot be folded | 146 | // The group consists of only one element, therefore it cannot be folded |
147 | None | 147 | None |
@@ -187,10 +187,7 @@ fn contiguous_range_for_comment( | |||
187 | } | 187 | } |
188 | 188 | ||
189 | if first != last { | 189 | if first != last { |
190 | Some(TextRange::from_to( | 190 | Some(TextRange::new(first.syntax().text_range().start(), last.syntax().text_range().end())) |
191 | first.syntax().text_range().start(), | ||
192 | last.syntax().text_range().end(), | ||
193 | )) | ||
194 | } else { | 191 | } else { |
195 | // The group consists of only one element, therefore it cannot be folded | 192 | // The group consists of only one element, therefore it cannot be folded |
196 | None | 193 | None |