aboutsummaryrefslogtreecommitdiff
path: root/xtask
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-03-13 11:55:04 +0000
committerGitHub <[email protected]>2020-03-13 11:55:04 +0000
commit02b44006b8e37a8cd3f96d5b1c949d62e01be2e8 (patch)
tree69121d32a0a4e6484945fe1afa7724ea11ed223a /xtask
parentb0ed808266e346b0f9330822f874e930710df4ec (diff)
parent680182d0a0853a3a76fd1cae9838feb5b0acf31c (diff)
Merge #3575
3575: Restore cargo-fmt gating r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'xtask')
-rw-r--r--xtask/src/lib.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/xtask/src/lib.rs b/xtask/src/lib.rs
index 014b61b37..e1472e85d 100644
--- a/xtask/src/lib.rs
+++ b/xtask/src/lib.rs
@@ -38,13 +38,11 @@ pub fn project_root() -> PathBuf {
38} 38}
39 39
40pub fn run_rustfmt(mode: Mode) -> Result<()> { 40pub fn run_rustfmt(mode: Mode) -> Result<()> {
41 let _dir = pushd(project_root());
41 ensure_rustfmt()?; 42 ensure_rustfmt()?;
42 43
43 if mode == Mode::Verify { 44 let check = if mode == Mode::Verify { "--check" } else { "" };
44 run!("rustup run {} -- cargo fmt -- --check", TOOLCHAIN)?; 45 run!("rustup run {} -- cargo fmt -- {}", TOOLCHAIN, check)?;
45 } else {
46 run!("rustup run {} -- cargo fmt", TOOLCHAIN)?;
47 }
48 Ok(()) 46 Ok(())
49} 47}
50 48