mirror of
https://github.com/Noratrieb/cargo-minimize.git
synced 2026-01-16 01:05:02 +01:00
test infra
This commit is contained in:
parent
1398d3d211
commit
75108c8553
6 changed files with 145 additions and 36 deletions
|
|
@ -4,7 +4,7 @@ mod reaper;
|
|||
|
||||
pub(crate) use self::files::SourceFile;
|
||||
use crate::{build::Build, processor::files::Changes, Options};
|
||||
use anyhow::{Context, Result};
|
||||
use anyhow::{bail, Context, Result};
|
||||
use owo_colors::OwoColorize;
|
||||
use std::{collections::HashSet, ffi::OsStr, fmt::Debug};
|
||||
|
||||
|
|
@ -49,7 +49,7 @@ pub(crate) struct Minimizer {
|
|||
}
|
||||
|
||||
impl Minimizer {
|
||||
pub(crate) fn new_glob_dir(options: Options, build: Build) -> Self {
|
||||
pub(crate) fn new_glob_dir(options: Options, build: Build) -> Result<Self> {
|
||||
let path = &options.path;
|
||||
let walk = walkdir::WalkDir::new(path);
|
||||
|
||||
|
|
@ -69,13 +69,17 @@ impl Minimizer {
|
|||
.inspect(|file| {
|
||||
info!("Collecting file: {}", file.path.display());
|
||||
})
|
||||
.collect();
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
Self {
|
||||
if files.is_empty() {
|
||||
bail!("Did not find any files for path {}", path.display());
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
files,
|
||||
build,
|
||||
options,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
pub(crate) fn run_passes<'a>(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue