From 2d4d178f8b043deb21db428f549a964ed2e0030c Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Mon, 12 Oct 2020 17:27:44 +0200 Subject: [PATCH] no$ --- Cargo.lock | 2 +- xtask/src/pre_cache.rs | 33 ++------------------------------- 2 files changed, 3 insertions(+), 32 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8e797ef5d0d2..1ec9a579ce89 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -# bla5 +# bla6 [[package]] name = "addr2line" version = "0.13.0" diff --git a/xtask/src/pre_cache.rs b/xtask/src/pre_cache.rs index 199c4fda440e..7077dc6a16b3 100644 --- a/xtask/src/pre_cache.rs +++ b/xtask/src/pre_cache.rs @@ -1,11 +1,8 @@ -use std::{ - fs::FileType, - path::{Path, PathBuf}, -}; +use std::path::Path; use anyhow::Result; -use crate::not_bash::{fs2, rm_rf}; +use crate::not_bash::rm_rf; pub struct PreCacheCmd; @@ -19,32 +16,6 @@ impl PreCacheCmd { } rm_rf(slow_tests_cookie)?; - for path in read_dir("./target/debug", FileType::is_file)? { - // Can't delete yourself on windows :-( - if !path.ends_with("xtask.exe") { - rm_rf(&path)? - } - } - - fs2::remove_file("./target/.rustc_info.json")?; - Ok(()) } } -fn read_dir(path: impl AsRef, cond: impl Fn(&FileType) -> bool) -> Result> { - read_dir_impl(path.as_ref(), &cond) -} - -fn read_dir_impl(path: &Path, cond: &dyn Fn(&FileType) -> bool) -> Result> { - let mut res = Vec::new(); - for entry in path.read_dir()? { - let entry = entry?; - let file_type = entry.file_type()?; - if cond(&file_type) { - res.push(entry.path()) - } - } - Ok(res) -} - -//