From 1f7a6c2a260fcf4cf5209f370b2a3e398a77d523 Mon Sep 17 00:00:00 2001 From: jRimbault Date: Tue, 27 Aug 2024 09:28:02 +0200 Subject: [PATCH] use bon --- src/fs/filter.rs | 1 - src/main.rs | 18 ++---------------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/src/fs/filter.rs b/src/fs/filter.rs index 4fb9aeb..f4945e4 100644 --- a/src/fs/filter.rs +++ b/src/fs/filter.rs @@ -64,7 +64,6 @@ impl Matcher for globset::GlobMatcher { } } -#[cfg(unix)] mod inode { use std::collections::HashSet; use std::fs::Metadata; diff --git a/src/main.rs b/src/main.rs index 78dcd52..1d9d305 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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()) @@ -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); @@ -123,9 +110,8 @@ pub struct Args { /// Maximum recursion depth #[clap(short = 'd', long = "depth", value_name = "depth")] max_depth: Option, - /// 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