diff options
Diffstat (limited to 'xtask/src/main.rs')
-rw-r--r-- | xtask/src/main.rs | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 3c4332f75..35cc7c108 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs | |||
@@ -28,7 +28,7 @@ use std::{ | |||
28 | use walkdir::{DirEntry, WalkDir}; | 28 | use walkdir::{DirEntry, WalkDir}; |
29 | use xshell::{cmd, cp, pushd, pushenv}; | 29 | use xshell::{cmd, cp, pushd, pushenv}; |
30 | 30 | ||
31 | use crate::{codegen::Mode, dist::DistCmd}; | 31 | use crate::dist::DistCmd; |
32 | 32 | ||
33 | fn main() -> Result<()> { | 33 | fn main() -> Result<()> { |
34 | let _d = pushd(project_root())?; | 34 | let _d = pushd(project_root())?; |
@@ -40,7 +40,6 @@ fn main() -> Result<()> { | |||
40 | return Ok(()); | 40 | return Ok(()); |
41 | } | 41 | } |
42 | flags::XtaskCmd::Install(cmd) => cmd.run(), | 42 | flags::XtaskCmd::Install(cmd) => cmd.run(), |
43 | flags::XtaskCmd::Codegen(cmd) => cmd.run(), | ||
44 | flags::XtaskCmd::Lint(_) => run_clippy(), | 43 | flags::XtaskCmd::Lint(_) => run_clippy(), |
45 | flags::XtaskCmd::FuzzTests(_) => run_fuzzer(), | 44 | flags::XtaskCmd::FuzzTests(_) => run_fuzzer(), |
46 | flags::XtaskCmd::PreCache(cmd) => cmd.run(), | 45 | flags::XtaskCmd::PreCache(cmd) => cmd.run(), |
@@ -85,18 +84,6 @@ fn rust_files_in(path: &Path) -> impl Iterator<Item = PathBuf> { | |||
85 | files_in(path, "rs") | 84 | files_in(path, "rs") |
86 | } | 85 | } |
87 | 86 | ||
88 | fn run_rustfmt(mode: Mode) -> Result<()> { | ||
89 | let _dir = pushd(project_root())?; | ||
90 | let _e = pushenv("RUSTUP_TOOLCHAIN", "stable"); | ||
91 | ensure_rustfmt()?; | ||
92 | let check = match mode { | ||
93 | Mode::Overwrite => &[][..], | ||
94 | Mode::Verify => &["--", "--check"], | ||
95 | }; | ||
96 | cmd!("cargo fmt {check...}").run()?; | ||
97 | Ok(()) | ||
98 | } | ||
99 | |||
100 | fn ensure_rustfmt() -> Result<()> { | 87 | fn ensure_rustfmt() -> Result<()> { |
101 | let out = cmd!("rustfmt --version").read()?; | 88 | let out = cmd!("rustfmt --version").read()?; |
102 | if !out.contains("stable") { | 89 | if !out.contains("stable") { |