Skip to content

Commit bdbcc6e

Browse files
committed
Fix clippy lints (use is_multiple_of, inline format strings)
1 parent ef07234 commit bdbcc6e

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/bin/alnstats.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ fn format_number(n: usize) -> String {
309309
let s = n.to_string();
310310
let mut result = String::new();
311311
for (i, c) in s.chars().rev().enumerate() {
312-
if i > 0 && i % 3 == 0 {
312+
if i > 0 && i.is_multiple_of(3) {
313313
result.push(',');
314314
}
315315
result.push(c);

src/fastga_integration.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ impl FastGAIntegration {
234234
std::fs::metadata(&temp_gdb_path)?.len()
235235
);
236236
} else {
237-
eprintln!("[fastga] WARNING: No .1gdb file found at {}", gdb_path);
237+
eprintln!("[fastga] WARNING: No .1gdb file found at {gdb_path}");
238238
}
239239

240240
// Clean up originals

src/main.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ fn calculate_ani_stats(input_path: &str, method: AniMethod, quiet: bool) -> Resu
614614

615615
// Get 50th percentile (median)
616616
let median_idx = ani_values.len() / 2;
617-
let ani50 = if ani_values.len() % 2 == 0 && ani_values.len() > 1 {
617+
let ani50 = if ani_values.len().is_multiple_of(2) && ani_values.len() > 1 {
618618
(ani_values[median_idx - 1] + ani_values[median_idx]) / 2.0
619619
} else {
620620
ani_values[median_idx]
@@ -826,7 +826,7 @@ fn calculate_ani_n_percentile(
826826

827827
// Get median
828828
let median_idx = ani_values.len() / 2;
829-
let ani50 = if ani_values.len() % 2 == 0 && ani_values.len() > 1 {
829+
let ani50 = if ani_values.len().is_multiple_of(2) && ani_values.len() > 1 {
830830
(ani_values[median_idx - 1] + ani_values[median_idx]) / 2.0
831831
} else {
832832
ani_values[median_idx]
@@ -1133,7 +1133,7 @@ fn align_multiple_fastas(
11331133
let input_file = &fasta_files[0];
11341134
// Canonicalize path to avoid empty parent directory issues in fastga-rs
11351135
let input_path = std::fs::canonicalize(input_file)
1136-
.with_context(|| format!("Failed to resolve path: {}", input_file))?;
1136+
.with_context(|| format!("Failed to resolve path: {input_file}"))?;
11371137
let temp_paf = fastga.align_to_temp_paf(&input_path, &input_path)?;
11381138

11391139
if !quiet {
@@ -1368,7 +1368,7 @@ fn main() -> Result<()> {
13681368

13691369
// Show help if no arguments provided
13701370
if args.files.is_empty() {
1371-
Args::parse_from(&["sweepga", "-h"]);
1371+
Args::parse_from(["sweepga", "-h"]);
13721372
}
13731373

13741374
let timing = TimingContext::new();
@@ -1812,7 +1812,7 @@ fn main() -> Result<()> {
18121812

18131813
// Canonicalize path to avoid empty parent directory issues in fastga-rs
18141814
let path = std::fs::canonicalize(&temp_path)
1815-
.with_context(|| format!("Failed to resolve path: {}", temp_path))?;
1815+
.with_context(|| format!("Failed to resolve path: {temp_path}"))?;
18161816
let fastga = create_fastga_integration(args.frequency, args.threads)?;
18171817
let temp_paf = fastga.align_to_temp_paf(&path, &path)?;
18181818

0 commit comments

Comments
 (0)