mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
Remove now dead code
This commit is contained in:
parent
095b9110b5
commit
e89c0e3961
9 changed files with 76 additions and 90 deletions
|
@ -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") {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue