mirror of
https://github.com/Noratrieb/cargo-minimize.git
synced 2026-01-15 08:55:02 +01:00
item deleter pass
This commit is contained in:
parent
22804c3065
commit
fdfde615f6
8 changed files with 162 additions and 5 deletions
|
|
@ -56,6 +56,15 @@ pub(crate) struct Minimizer {
|
|||
}
|
||||
|
||||
impl Minimizer {
|
||||
fn pass_disabled(&self, name: &str) -> bool {
|
||||
if let Some(passes) = &self.options.passes {
|
||||
if !passes.split(",").any(|allowed| name == allowed) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
false
|
||||
}
|
||||
|
||||
pub(crate) fn new_glob_dir(options: Options, build: Build) -> Result<Self> {
|
||||
let path = &options.path;
|
||||
let walk = walkdir::WalkDir::new(path);
|
||||
|
|
@ -102,6 +111,9 @@ impl Minimizer {
|
|||
inital_build.require_reproduction("Initial")?;
|
||||
|
||||
for mut pass in passes {
|
||||
if self.pass_disabled(pass.name()) {
|
||||
continue;
|
||||
}
|
||||
self.run_pass(&mut *pass)?;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue