diff options
Diffstat (limited to 'xtask/src/lib.rs')
-rw-r--r-- | xtask/src/lib.rs | 8 |
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 | ||
40 | pub fn run_rustfmt(mode: Mode) -> Result<()> { | 40 | pub 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 | ||