Skip to content

Commit 4fb9eee

Browse files
Fix clippy lints flagged by newer stable (1.95)
- duration_suboptimal_units: Duration::from_millis(1000) -> from_secs(1) - manual_checked_ops: manual zero-guarded division -> checked_div().unwrap_or(0) Both are no-op behaviorally; the workspace denies all+pedantic so CI's newer stable clippy failed the test+clippy job. Functionally identical.
1 parent 046e4f5 commit 4fb9eee

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎src/lib.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ fn qualifying_pairs(chars: &[Vec<char>], sams: &[gestalt::Sam], threshold: f64)
439439
let rows = &rows;
440440
scope.spawn(move || {
441441
while rows.load(Ordering::Relaxed) < n {
442-
std::thread::sleep(std::time::Duration::from_millis(1000));
442+
std::thread::sleep(std::time::Duration::from_secs(1));
443443
let done = rows.load(Ordering::Relaxed);
444444
eprintln!(" [difflib-fast] qualifying_pairs: row {done}/{n} ({:.0}%)", done as f64 / n as f64 * 100.0);
445445
}
@@ -616,7 +616,7 @@ fn minhash(shingles: &[u64], perms: &[(u64, u64)]) -> Vec<u64> {
616616
/// LSH candidate pairs: documents that share a full band signature in any band (an O(n)-ish proxy
617617
/// for "Jaccard above the band threshold" — recall tuned via `band_rows`).
618618
fn lsh_candidates(sigs: &[Vec<u64>], band_rows: usize) -> HashSet<(usize, usize)> {
619-
let bands = if band_rows == 0 { 0 } else { sigs.first().map_or(0, Vec::len) / band_rows };
619+
let bands = sigs.first().map_or(0, Vec::len).checked_div(band_rows).unwrap_or(0);
620620
let mut candidates: HashSet<(usize, usize)> = HashSet::new();
621621
for band in 0..bands {
622622
let lo = band * band_rows;

0 commit comments

Comments
 (0)