diff options
Diffstat (limited to 'crates/ra_lsp_server/src/main_loop/handlers.rs')
-rw-r--r-- | crates/ra_lsp_server/src/main_loop/handlers.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs index ecfa42206..a2c12a4c1 100644 --- a/crates/ra_lsp_server/src/main_loop/handlers.rs +++ b/crates/ra_lsp_server/src/main_loop/handlers.rs | |||
@@ -625,10 +625,11 @@ pub fn handle_formatting( | |||
625 | let output = rustfmt.wait_with_output()?; | 625 | let output = rustfmt.wait_with_output()?; |
626 | let captured_stdout = String::from_utf8(output.stdout)?; | 626 | let captured_stdout = String::from_utf8(output.stdout)?; |
627 | if !output.status.success() { | 627 | if !output.status.success() { |
628 | return Err(failure::err_msg(format!( | 628 | failure::bail!( |
629 | "rustfmt exited with error code {}: {}.", | 629 | "rustfmt exited with error code {}: {}.", |
630 | output.status, captured_stdout | 630 | output.status, |
631 | ))); | 631 | captured_stdout, |
632 | ); | ||
632 | } | 633 | } |
633 | 634 | ||
634 | Ok(Some(vec![TextEdit { | 635 | Ok(Some(vec![TextEdit { |