diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-06-16 20:58:33 +0100 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-06-16 20:58:33 +0100 |
commit | 1541b2d689393221938d7cb935862f76395874e9 (patch) | |
tree | 5f9c9c4dc33f2ad7a1350ffb7b0459abcd7fbc41 /crates/ra_tools/src/bin | |
parent | 924d4d7ca8bce948b8cbb30ef6da17354e48bad3 (diff) | |
parent | d3e74bfd2c1f7dca2054e1cfdc7aa312c9d12c98 (diff) |
Merge #1409
1409: The Fall down of failures r=matklad a=mominul
:grin:
Replaced all the uses of `failure` crate with `std::error::Error`.
Closes #1400
Depends on rust-analyzer/teraron#1
Co-authored-by: Muhammad Mominul Huque <[email protected]>
Diffstat (limited to 'crates/ra_tools/src/bin')
-rw-r--r-- | crates/ra_tools/src/bin/pre-commit.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/crates/ra_tools/src/bin/pre-commit.rs b/crates/ra_tools/src/bin/pre-commit.rs index c514e992b..95bb55cae 100644 --- a/crates/ra_tools/src/bin/pre-commit.rs +++ b/crates/ra_tools/src/bin/pre-commit.rs | |||
@@ -1,7 +1,5 @@ | |||
1 | use std::process::Command; | 1 | use std::process::Command; |
2 | 2 | ||
3 | use failure::bail; | ||
4 | |||
5 | use ra_tools::{Result, run_rustfmt, run, project_root, Overwrite}; | 3 | use ra_tools::{Result, run_rustfmt, run, project_root, Overwrite}; |
6 | 4 | ||
7 | fn main() -> Result<()> { | 5 | fn main() -> Result<()> { |
@@ -19,7 +17,10 @@ fn update_staged() -> Result<()> { | |||
19 | .current_dir(&root) | 17 | .current_dir(&root) |
20 | .output()?; | 18 | .output()?; |
21 | if !output.status.success() { | 19 | if !output.status.success() { |
22 | bail!("`git diff --diff-filter=MAR --name-only --cached` exited with {}", output.status); | 20 | Err(format!( |
21 | "`git diff --diff-filter=MAR --name-only --cached` exited with {}", | ||
22 | output.status | ||
23 | ))?; | ||
23 | } | 24 | } |
24 | for line in String::from_utf8(output.stdout)?.lines() { | 25 | for line in String::from_utf8(output.stdout)?.lines() { |
25 | run(&format!("git update-index --add {}", root.join(line).to_string_lossy()), ".")?; | 26 | run(&format!("git update-index --add {}", root.join(line).to_string_lossy()), ".")?; |