mirror of
https://github.com/Noratrieb/cargo-minimize.git
synced 2026-01-15 08:55:02 +01:00
more
This commit is contained in:
parent
9243224163
commit
02b8eaa7b2
5 changed files with 30 additions and 9 deletions
|
|
@ -1,5 +1,7 @@
|
|||
use std::{borrow::Borrow, collections::BTreeSet, fmt::Debug, mem};
|
||||
|
||||
use crate::Options;
|
||||
|
||||
use self::worklist::Worklist;
|
||||
|
||||
#[derive(Clone, PartialEq, Eq, Hash, PartialOrd, Ord)]
|
||||
|
|
@ -20,6 +22,7 @@ impl Debug for AstPath {
|
|||
#[derive(Debug)]
|
||||
pub(crate) struct PassController {
|
||||
state: PassControllerState,
|
||||
pub(crate) options: Options,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
|
|
@ -86,11 +89,12 @@ fn split_owned<T, From: IntoIterator<Item = T>, A: FromIterator<T>, B: FromItera
|
|||
}
|
||||
|
||||
impl PassController {
|
||||
pub fn new() -> Self {
|
||||
pub fn new(options: Options) -> Self {
|
||||
Self {
|
||||
state: PassControllerState::InitialCollection {
|
||||
candidates: Vec::new(),
|
||||
},
|
||||
options,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -181,7 +181,7 @@ impl Minimizer {
|
|||
invalidated_files: &mut HashSet<&'file SourceFile>,
|
||||
changes: &mut Changes,
|
||||
) -> Result<()> {
|
||||
let mut checker = PassController::new();
|
||||
let mut checker = PassController::new(self.options.clone());
|
||||
loop {
|
||||
let file_display = file.path.display();
|
||||
let mut change = file.try_change(changes)?;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue