aboutsummaryrefslogtreecommitdiff
path: root/xtask/src/main.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2021-03-08 18:39:09 +0000
committerAleksey Kladov <[email protected]>2021-03-08 18:45:43 +0000
commite89c0e39613e381da45b6a774c6666dcc3e632a2 (patch)
tree8a2e53e4c97381f628eeedae92c9df71b4625287 /xtask/src/main.rs
parent095b9110b5e4e166c86501a1f0603cf626a48127 (diff)
Remove now dead code
Diffstat (limited to 'xtask/src/main.rs')
-rw-r--r--xtask/src/main.rs19
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::{
28use walkdir::{DirEntry, WalkDir}; 28use walkdir::{DirEntry, WalkDir};
29use xshell::{cmd, cp, pushd, pushenv}; 29use xshell::{cmd, cp, pushd, pushenv};
30 30
31use crate::{codegen::Mode, dist::DistCmd}; 31use crate::dist::DistCmd;
32 32
33fn main() -> Result<()> { 33fn 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
87fn 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
104fn ensure_rustfmt() -> Result<()> { 87fn 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") {