mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-27 05:23:24 +00:00
Simplify failure bail code
This commit is contained in:
parent
ed47c93afe
commit
0cb270e75d
1 changed files with 4 additions and 3 deletions
|
@ -625,10 +625,11 @@ pub fn handle_formatting(
|
|||
let output = rustfmt.wait_with_output()?;
|
||||
let captured_stdout = String::from_utf8(output.stdout)?;
|
||||
if !output.status.success() {
|
||||
return Err(failure::err_msg(format!(
|
||||
failure::bail!(
|
||||
"rustfmt exited with error code {}: {}.",
|
||||
output.status, captured_stdout
|
||||
)));
|
||||
output.status,
|
||||
captured_stdout,
|
||||
);
|
||||
}
|
||||
|
||||
Ok(Some(vec![TextEdit {
|
||||
|
|
Loading…
Reference in a new issue