mirror of
https://github.com/Noratrieb/cargo-minimize.git
synced 2026-01-14 16:35:01 +01:00
Actually, let's not bisect imports by default
I thought it was a good idea, but now that reaper is not completely busted, i see that this is taking a bit longer than i'd like.. It's easier to just run reaper again
This commit is contained in:
parent
4af04f2191
commit
7b28f80cd6
3 changed files with 7 additions and 1 deletions
|
|
@ -105,6 +105,10 @@ pub struct Options {
|
|||
|
||||
#[arg(skip)]
|
||||
pub no_delete_functions: bool,
|
||||
|
||||
/// Remove individual use statements manually, instead of relying on rustc lints output
|
||||
#[arg(long)]
|
||||
pub bisect_delete_imports: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
|
|
@ -187,6 +191,7 @@ impl Default for Options {
|
|||
script_path_lints: None,
|
||||
ignore_file: Vec::new(),
|
||||
no_delete_functions: false,
|
||||
bisect_delete_imports: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ impl<'a> Visitor<'a> {
|
|||
}
|
||||
// We would hope for the unused imports pass to catch all of these
|
||||
// but sadly that's not the case
|
||||
Item::Use(ItemUse { tree, .. }) => {
|
||||
Item::Use(ItemUse { tree, .. }) if self.checker.options.bisect_delete_imports => {
|
||||
self.current_path.push(tree.to_token_stream().to_string());
|
||||
|
||||
let should_retain = self.should_retain_item();
|
||||
|
|
|
|||
|
|
@ -170,6 +170,7 @@ fn build(cargo: &Path, path: &Path, regression_checker_path: &Path) -> Result<()
|
|||
flag.push(regression_checker_path);
|
||||
flag
|
||||
});
|
||||
cmd.arg("--bisect-delete-imports");
|
||||
|
||||
let minimize_roots = start_roots.join(",");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue