Skip to content

Commit

Permalink
use bon
Browse files Browse the repository at this point in the history
  • Loading branch information
jRimbault committed Aug 27, 2024
1 parent f94a23c commit 1f7a6c2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
1 change: 0 additions & 1 deletion src/fs/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ impl Matcher for globset::GlobMatcher {
}
}

#[cfg(unix)]
mod inode {
use std::collections::HashSet;
use std::fs::Metadata;
Expand Down
18 changes: 2 additions & 16 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ fn main() -> anyhow::Result<()> {
Ok(())
}

#[cfg(unix)]
fn build_config(args: &Args) -> yadf::Yadf {
yadf::Yadf::builder()
.paths(args.paths.clone())
Expand All @@ -48,18 +47,6 @@ fn build_config(args: &Args) -> yadf::Yadf {
.build()
}

#[cfg(not(unix))]
fn build_config(args: &Args) -> yadf::Yadf {
yadf::Yadf::builder()
.paths(args.paths.clone())
.maybe_minimum_file_size(args.min())
.maybe_maximum_file_size(args.max())
.maybe_regex(args.regex.clone())
.maybe_glob(args.pattern.clone())
.maybe_max_depth(args.max_depth)
.build()
}

impl Algorithm {
fn run(&self, config: yadf::Yadf) -> yadf::FileCounter {
log::debug!("using {:?} hashing", self);
Expand Down Expand Up @@ -123,9 +110,8 @@ pub struct Args {
/// Maximum recursion depth
#[clap(short = 'd', long = "depth", value_name = "depth")]
max_depth: Option<usize>,
/// Treat hard links to same file as duplicates
#[cfg_attr(unix, clap(short = 'H', long))]
#[cfg(unix)]
/// Treat hard links to same file as duplicates (unix only)
#[clap(short = 'H', long)]
hard_links: bool,
/// Check files with a name matching a Perl-style regex,
/// see: https://docs.rs/regex/1.4.2/regex/index.html#syntax
Expand Down

0 comments on commit 1f7a6c2

Please sign in to comment.