Skip to content

Commit

Permalink
Update deps. Use std::thread::available_parallelism() instead of num_…
Browse files Browse the repository at this point in the history
…cpus.
  • Loading branch information
dkorunic committed Feb 16, 2024
1 parent 24697c0 commit b574ff2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
11 changes: 5 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "findlargedir"
version = "0.6.2"
version = "0.6.3"
authors = ["Dinko Korunic <[email protected]>"]
categories = ["command-line-utilities"]
description = "find all blackhole directories with a huge amount of filesystem entries in a flat structure"
Expand All @@ -12,19 +12,18 @@ edition = "2021"

[dependencies]
jwalk = "0.8.1"
rayon = "1.8.0"
num_cpus = "1.16.0"
tempfile = "3.9.0"
rayon = "1.8.1"
tempfile = "3.10.0"
anyhow = "1.0.79"
human_format = "1.0.3"
human_bytes = { version = "0.4.3", features = ["fast"] }
humantime = "2.1.0"
clap = { version = "4.4.13", features = ["derive"] }
clap = { version = "4.5.1", features = ["derive"] }
ctrlc = { version = "3.4.2", features = ["termination"] }
rm_rf = "0.6.2"
ansi_term = "0.12.1"
fs-err = "2.11.0"
indicatif = { version = "0.17.7", features = ["rayon"] }
indicatif = { version = "0.17.8", features = ["rayon"] }
cfg-if = "1.0"
fdlimit = "0.3.0"

Expand Down
3 changes: 2 additions & 1 deletion src/args.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use std::path::PathBuf;
use std::thread;

use anyhow::{anyhow, Error};
use clap::builder::ValueParser;
Expand Down Expand Up @@ -29,7 +30,7 @@ pub struct Args {
pub blacklist_threshold: u64,

/// Number of threads to use when calibrating and scanning
#[clap(short = 'x', long, value_parser = ValueParser::new(parse_threads), default_value_t = num_cpus::get())]
#[clap(short = 'x', long, value_parser = ValueParser::new(parse_threads), default_value_t = thread::available_parallelism().map(| n | n.get()).unwrap_or(1))]
pub threads: usize,

/// Seconds between status updates, set to 0 to disable
Expand Down
12 changes: 6 additions & 6 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
#![warn(clippy::all, clippy::pedantic)]

use anyhow::{Context, Error, Result};
use cfg_if::cfg_if;
use clap::Parser;
use fdlimit::{raise_fd_limit, Outcome};
use humantime::Duration as HumanDuration;
use std::collections::HashSet;
use std::os::unix::fs::MetadataExt;
use std::sync::atomic::AtomicBool;
use std::sync::Arc;
use std::time::Instant;
use tempfile::TempDir;

use anyhow::{Context, Error, Result};
use cfg_if::cfg_if;
use clap::Parser;
use fdlimit::{raise_fd_limit, Outcome};
use fs_err as fs;
use humantime::Duration as HumanDuration;
use tempfile::TempDir;

mod args;
mod calibrate;
Expand Down

0 comments on commit b574ff2

Please sign in to comment.