diff options
Diffstat (limited to 'crates/ra_ide/src/diagnostics.rs')
-rw-r--r-- | crates/ra_ide/src/diagnostics.rs | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/crates/ra_ide/src/diagnostics.rs b/crates/ra_ide/src/diagnostics.rs index a10e642db..c1d7ddaf2 100644 --- a/crates/ra_ide/src/diagnostics.rs +++ b/crates/ra_ide/src/diagnostics.rs | |||
@@ -200,8 +200,8 @@ fn check_struct_shorthand_initialization( | |||
200 | #[cfg(test)] | 200 | #[cfg(test)] |
201 | mod tests { | 201 | mod tests { |
202 | use insta::assert_debug_snapshot; | 202 | use insta::assert_debug_snapshot; |
203 | use join_to_string::join; | ||
204 | use ra_syntax::SourceFile; | 203 | use ra_syntax::SourceFile; |
204 | use stdx::SepBy; | ||
205 | use test_utils::assert_eq_text; | 205 | use test_utils::assert_eq_text; |
206 | 206 | ||
207 | use crate::mock_analysis::{analysis_and_position, single_file}; | 207 | use crate::mock_analysis::{analysis_and_position, single_file}; |
@@ -254,16 +254,12 @@ mod tests { | |||
254 | .map(|it| it.len() - it.trim_start().len()) | 254 | .map(|it| it.len() - it.trim_start().len()) |
255 | .next() | 255 | .next() |
256 | .expect("empty fixture"); | 256 | .expect("empty fixture"); |
257 | let after = join(after.lines().filter_map(|line| { | 257 | let after = after |
258 | if line.len() > margin { | 258 | .lines() |
259 | Some(&line[margin..]) | 259 | .filter_map(|line| if line.len() > margin { Some(&line[margin..]) } else { None }) |
260 | } else { | 260 | .sep_by("\n") |
261 | None | 261 | .suffix("\n") |
262 | } | 262 | .to_string(); |
263 | })) | ||
264 | .separator("\n") | ||
265 | .suffix("\n") | ||
266 | .to_string(); | ||
267 | 263 | ||
268 | assert_eq_text!(&after, &actual); | 264 | assert_eq_text!(&after, &actual); |
269 | assert!( | 265 | assert!( |