Skip to content

Commit 1b1eef6

Browse files
committed
chore: cleanup low-severity findings from code review
- Remove no-op test_empty_supplied_paths (asserted literal, not code) - Restore panic = 'abort' in release profile (CLAUDE.md says it's active) - Remove commented-out readonly dependency - Make PROGRESS_THRESHOLD_MILLIS pub const, remove threshold_millis() wrapper
1 parent f0244af commit 1b1eef6

File tree

4 files changed

+3
-30
lines changed

4 files changed

+3
-30
lines changed

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ edition = "2024"
66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
77

88
[profile.release]
9-
# panic = 'abort'
9+
panic = 'abort'
1010
codegen-units = 1
1111
lto = 'fat'
1212
strip = true
@@ -21,7 +21,6 @@ hex = "0.4"
2121
data-encoding = "2.10"
2222
pico-args = "0.5"
2323
rayon = "1.11"
24-
# readonly = "0.2"
2524
generic-array = "1.3"
2625
byteorder = { default-features = false, version = "1.5" }
2726
md-5 = { default-features = false, version = "0.10" }

src/core/worker.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ fn hash_with_progress(
179179
}
180180

181181
if config.debug_mode
182-
&& elapsed >= Duration::from_millis(ProgressCoordinator::threshold_millis())
182+
&& elapsed >= Duration::from_millis(crate::progress::PROGRESS_THRESHOLD_MILLIS)
183183
{
184184
eprintln!(
185185
"File '{}' took {:.2}s to hash",

src/progress.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use indicatif::{MultiProgress, ProgressBar, ProgressStyle};
88
use std::sync::Arc;
99
use std::time::Duration;
1010

11-
const PROGRESS_THRESHOLD_MILLIS: u64 = 200;
11+
pub const PROGRESS_THRESHOLD_MILLIS: u64 = 200;
1212

1313
/// Coordinator for all progress indication
1414
///
@@ -64,14 +64,6 @@ impl ProgressCoordinator {
6464
pb.enable_steady_tick(Duration::from_millis(350));
6565
pb
6666
}
67-
68-
/// Get the progress threshold in milliseconds
69-
///
70-
/// Operations faster than this threshold should not display progress indication
71-
/// to avoid visual flashing.
72-
pub fn threshold_millis() -> u64 {
73-
PROGRESS_THRESHOLD_MILLIS
74-
}
7567
}
7668

7769
impl Default for ProgressCoordinator {

src/unit_tests.rs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -599,22 +599,4 @@ mod glob_tests {
599599
assert!(!path.ends_with("subdir"));
600600
}
601601
}
602-
603-
#[test]
604-
fn test_empty_supplied_paths() {
605-
// This would normally read from stdin, but we're testing the config behavior
606-
let config = ConfigSettings {
607-
debug_mode: false,
608-
exclude_fn: false,
609-
single_thread: false,
610-
case_sensitive: true,
611-
no_progress: false,
612-
algorithm: HashAlgorithm::SHA3_256,
613-
encoding: OutputEncoding::Hex,
614-
limit_num: None,
615-
supplied_paths: Vec::new(),
616-
};
617-
618-
assert!(config.supplied_paths.is_empty());
619-
}
620602
}

0 commit comments

Comments
 (0)