mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 14:21:44 +00:00
Restore cargo-fmt gating
This commit is contained in:
parent
1e19847af3
commit
680182d0a0
4 changed files with 12 additions and 19 deletions
|
@ -38,13 +38,11 @@ pub fn project_root() -> PathBuf {
|
|||
}
|
||||
|
||||
pub fn run_rustfmt(mode: Mode) -> Result<()> {
|
||||
let _dir = pushd(project_root());
|
||||
ensure_rustfmt()?;
|
||||
|
||||
if mode == Mode::Verify {
|
||||
run!("rustup run {} -- cargo fmt -- --check", TOOLCHAIN)?;
|
||||
} else {
|
||||
run!("rustup run {} -- cargo fmt", TOOLCHAIN)?;
|
||||
}
|
||||
let check = if mode == Mode::Verify { "--check" } else { "" };
|
||||
run!("rustup run {} -- cargo fmt -- {}", TOOLCHAIN, check)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue