diff options
author | Phil Ellison <[email protected]> | 2019-08-11 15:04:08 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-08-25 10:55:56 +0100 |
commit | 4f6f3933ec04df55a39368d591c91cf81d980237 (patch) | |
tree | ad9d77f715652be53185c9efa9ebff683ac4c5c0 /crates/ra_ide_api | |
parent | 456e72c4e472d9ea0717c64a75bd02e94b6e90e8 (diff) |
cargo format
Diffstat (limited to 'crates/ra_ide_api')
-rw-r--r-- | crates/ra_ide_api/src/diagnostics.rs | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/crates/ra_ide_api/src/diagnostics.rs b/crates/ra_ide_api/src/diagnostics.rs index 9841fbdf3..0b9bb5a66 100644 --- a/crates/ra_ide_api/src/diagnostics.rs +++ b/crates/ra_ide_api/src/diagnostics.rs | |||
@@ -217,7 +217,8 @@ mod tests { | |||
217 | } | 217 | } |
218 | 218 | ||
219 | fn check_apply_diagnostic_fix_for_target_file(target_file: &str, fixture: &str, after: &str) { | 219 | fn check_apply_diagnostic_fix_for_target_file(target_file: &str, fixture: &str, after: &str) { |
220 | let (analysis, file_id, target_file_contents) = fixture_with_target_file(fixture, target_file); | 220 | let (analysis, file_id, target_file_contents) = |
221 | fixture_with_target_file(fixture, target_file); | ||
221 | let diagnostic = analysis.diagnostics(file_id).unwrap().pop().unwrap(); | 222 | let diagnostic = analysis.diagnostics(file_id).unwrap().pop().unwrap(); |
222 | let mut fix = diagnostic.fix.unwrap(); | 223 | let mut fix = diagnostic.fix.unwrap(); |
223 | let edit = fix.source_file_edits.pop().unwrap().edit; | 224 | let edit = fix.source_file_edits.pop().unwrap().edit; |
@@ -267,9 +268,9 @@ mod tests { | |||
267 | pub enum Result<T, E> { Ok(T), Err(E) } | 268 | pub enum Result<T, E> { Ok(T), Err(E) } |
268 | } | 269 | } |
269 | "#; | 270 | "#; |
270 | // The formatting here is a bit odd due to how the parse_fixture function works in test_utils - | 271 | // The formatting here is a bit odd due to how the parse_fixture function works in test_utils - |
271 | // it strips empty lines and leading whitespace. The important part of this test is that the final | 272 | // it strips empty lines and leading whitespace. The important part of this test is that the final |
272 | // `x / y` expr is now wrapped in `Ok(..)` | 273 | // `x / y` expr is now wrapped in `Ok(..)` |
273 | let after = r#"use std::{string::String, result::Result::{self, Ok, Err}}; | 274 | let after = r#"use std::{string::String, result::Result::{self, Ok, Err}}; |
274 | fn div(x: i32, y: i32) -> Result<i32, String> { | 275 | fn div(x: i32, y: i32) -> Result<i32, String> { |
275 | if y == 0 { | 276 | if y == 0 { |
@@ -299,9 +300,9 @@ fn div(x: i32, y: i32) -> Result<i32, String> { | |||
299 | pub enum Result<T, E> { Ok(T), Err(E) } | 300 | pub enum Result<T, E> { Ok(T), Err(E) } |
300 | } | 301 | } |
301 | "#; | 302 | "#; |
302 | // The formatting here is a bit odd due to how the parse_fixture function works in test_utils - | 303 | // The formatting here is a bit odd due to how the parse_fixture function works in test_utils - |
303 | // it strips empty lines and leading whitespace. The important part of this test is that the final | 304 | // it strips empty lines and leading whitespace. The important part of this test is that the final |
304 | // expr is now wrapped in `Ok(..)` | 305 | // expr is now wrapped in `Ok(..)` |
305 | let after = r#"use std::result::Result::{self, Ok, Err}; | 306 | let after = r#"use std::result::Result::{self, Ok, Err}; |
306 | fn div<T>(x: T) -> Result<T, i32> { | 307 | fn div<T>(x: T) -> Result<T, i32> { |
307 | if x == 0 { | 308 | if x == 0 { |
@@ -336,9 +337,9 @@ fn div<T>(x: T) -> Result<T, i32> { | |||
336 | pub enum Result<T, E> { Ok(T), Err(E) } | 337 | pub enum Result<T, E> { Ok(T), Err(E) } |
337 | } | 338 | } |
338 | "#; | 339 | "#; |
339 | // The formatting here is a bit odd due to how the parse_fixture function works in test_utils - | 340 | // The formatting here is a bit odd due to how the parse_fixture function works in test_utils - |
340 | // it strips empty lines and leading whitespace. The important part of this test is that the final | 341 | // it strips empty lines and leading whitespace. The important part of this test is that the final |
341 | // `x / y` expr is now wrapped in `Ok(..)` | 342 | // `x / y` expr is now wrapped in `Ok(..)` |
342 | let after = r#"use std::{string::String, result::Result::{self, Ok, Err}}; | 343 | let after = r#"use std::{string::String, result::Result::{self, Ok, Err}}; |
343 | type MyResult<T> = Result<T, String>; | 344 | type MyResult<T> = Result<T, String>; |
344 | fn div(x: i32, y: i32) -> MyResult<i32> { | 345 | fn div(x: i32, y: i32) -> MyResult<i32> { |