mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-29 02:03:53 +00:00
Simplify failure bail code
This commit is contained in:
parent
ed47c93afe
commit
0cb270e75d
@ -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 New Issue
Block a user