Remove now dead code

This commit is contained in:
Aleksey Kladov 2021-03-08 21:39:09 +03:00
parent 095b9110b5
commit e89c0e3961
9 changed files with 76 additions and 90 deletions

View file

@ -28,7 +28,7 @@ use std::{
use walkdir::{DirEntry, WalkDir};
use xshell::{cmd, cp, pushd, pushenv};
use crate::{codegen::Mode, dist::DistCmd};
use crate::dist::DistCmd;
fn main() -> Result<()> {
let _d = pushd(project_root())?;
@ -84,23 +84,6 @@ fn rust_files_in(path: &Path) -> impl Iterator<Item = PathBuf> {
files_in(path, "rs")
}
fn run_rustfmt(mode: Mode) -> Result<()> {
let _dir = pushd(project_root())?;
let _e = pushenv("RUSTUP_TOOLCHAIN", "stable");
ensure_rustfmt()?;
match mode {
Mode::Overwrite => cmd!("cargo fmt").run()?,
Mode::Ensure => {
let res = cmd!("cargo fmt -- --check").run();
if !res.is_ok() {
let _ = cmd!("cargo fmt").run();
}
res?;
}
};
Ok(())
}
fn ensure_rustfmt() -> Result<()> {
let out = cmd!("rustfmt --version").read()?;
if !out.contains("stable") {