aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src/diagnostics.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-03-28 10:01:25 +0000
committerAleksey Kladov <[email protected]>2020-03-28 10:01:25 +0000
commitb764c38436fcb9426eb7da3be4f5fbcd63b316f5 (patch)
treea599f1ffff953040a0c2bb635b33b0f6a57e5e59 /crates/ra_ide/src/diagnostics.rs
parenta1fea0d34ee8f3436aefd87d4c133a7ff50ffbb0 (diff)
Start stdx
This crate will hold everything to small to be worth publishing
Diffstat (limited to 'crates/ra_ide/src/diagnostics.rs')
-rw-r--r--crates/ra_ide/src/diagnostics.rs18
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)]
201mod tests { 201mod 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!(