From 7c7110db9e6fa4484dd5938d41a177ea8345936b Mon Sep 17 00:00:00 2001 From: Nils Homer Date: Thu, 30 Apr 2026 13:08:11 -0700 Subject: [PATCH 1/2] fix(clippy): address new lints from rust-1.95 Three new clippy errors started firing on `-D warnings` after the rust-1.95 release: - `clippy::manual_checked_ops` in src/catalog/builder.rs: rewrite the `pct` closure with `checked_div(total).unwrap_or(0)`, which is semantically identical to the existing `if total == 0 { 0 } else { (n * 100) / total }` form. - `clippy::unnecessary_sort_by` in src/catalog/index.rs (x2): replace `sort_by(|a, b| b.1.cmp(&a.1))` with `sort_by_key(|b| std::cmp::Reverse(b.1))`. Both forms produce a stable sort by `.1` descending. No behavioral change. Unblocks the pre-commit hook so README and other commits can land again. --- src/catalog/builder.rs | 8 +------- src/catalog/index.rs | 4 ++-- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/catalog/builder.rs b/src/catalog/builder.rs index 2d8769b..06ed703 100644 --- a/src/catalog/builder.rs +++ b/src/catalog/builder.rs @@ -987,13 +987,7 @@ impl std::fmt::Display for BuildSummary { writeln!(f)?; writeln!(f, "Coverage:")?; - let pct = |n: usize, total: usize| { - if total == 0 { - 0 - } else { - (n * 100) / total - } - }; + let pct = |n: usize, total: usize| (n * 100).checked_div(total).unwrap_or(0); let check = |n: usize, total: usize| { if n == total { "+" diff --git a/src/catalog/index.rs b/src/catalog/index.rs index 1106169..54046f1 100644 --- a/src/catalog/index.rs +++ b/src/catalog/index.rs @@ -30,7 +30,7 @@ impl<'a> CandidateFinder<'a> { } let mut candidates: Vec<_> = ref_counts.into_iter().collect(); - candidates.sort_by(|a, b| b.1.cmp(&a.1)); // Sort by count descending + candidates.sort_by_key(|b| std::cmp::Reverse(b.1)); // Sort by count descending candidates } @@ -68,7 +68,7 @@ impl<'a> CandidateFinder<'a> { } let mut candidates: Vec<_> = ref_counts.into_iter().collect(); - candidates.sort_by(|a, b| b.1.cmp(&a.1)); + candidates.sort_by_key(|b| std::cmp::Reverse(b.1)); candidates } From 55b1c4644cfaf475ee45f7057a7b1462975313fa Mon Sep 17 00:00:00 2001 From: Nils Homer Date: Thu, 30 Apr 2026 13:34:41 -0700 Subject: [PATCH 2/2] docs(readme): use absolute URLs for logo images Use https://raw.githubusercontent.com///main/... for logo references so they render on crates.io. Relative paths render correctly on GitHub but are dropped by the crates.io README sanitizer, leaving a broken image at the top of every crate page. --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 44df649..0ac1397 100644 --- a/README.md +++ b/README.md @@ -13,9 +13,9 @@ Identify which human reference genome was used to align a BAM/SAM/CRAM file.

- - - Fulcrum Genomics + + + Fulcrum Genomics