diff options
author | Aleksey Kladov <[email protected]> | 2021-03-08 18:39:09 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2021-03-08 18:45:43 +0000 |
commit | e89c0e39613e381da45b6a774c6666dcc3e632a2 (patch) | |
tree | 8a2e53e4c97381f628eeedae92c9df71b4625287 /xtask/src/main.rs | |
parent | 095b9110b5e4e166c86501a1f0603cf626a48127 (diff) |
Remove now dead code
Diffstat (limited to 'xtask/src/main.rs')
-rw-r--r-- | xtask/src/main.rs | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/xtask/src/main.rs b/xtask/src/main.rs index c2dda928e..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())?; |
@@ -84,23 +84,6 @@ fn rust_files_in(path: &Path) -> impl Iterator<Item = PathBuf> { | |||
84 | files_in(path, "rs") | 84 | files_in(path, "rs") |
85 | } | 85 | } |
86 | 86 | ||
87 | fn run_rustfmt(mode: Mode) -> Result<()> { | ||
88 | let _dir = pushd(project_root())?; | ||
89 | let _e = pushenv("RUSTUP_TOOLCHAIN", "stable"); | ||
90 | ensure_rustfmt()?; | ||
91 | match mode { | ||
92 | Mode::Overwrite => cmd!("cargo fmt").run()?, | ||
93 | Mode::Ensure => { | ||
94 | let res = cmd!("cargo fmt -- --check").run(); | ||
95 | if !res.is_ok() { | ||
96 | let _ = cmd!("cargo fmt").run(); | ||
97 | } | ||
98 | res?; | ||
99 | } | ||
100 | }; | ||
101 | Ok(()) | ||
102 | } | ||
103 | |||
104 | fn ensure_rustfmt() -> Result<()> { | 87 | fn ensure_rustfmt() -> Result<()> { |
105 | let out = cmd!("rustfmt --version").read()?; | 88 | let out = cmd!("rustfmt --version").read()?; |
106 | if !out.contains("stable") { | 89 | if !out.contains("stable") { |