Skip to content

Commit 7008c13

Browse files
committed
Fix clippy warnings: add allow(dead_code) for aln_filter module
1 parent 11445e3 commit 7008c13

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

src/aln_filter.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
//! - Applies sweepga filtering logic
1010
//! - Writes filtered .1aln using fastga-rs AlnWriter
1111
12+
// TODO: Remove this once the module is integrated into the main code path
13+
#![allow(dead_code)]
14+
1215
use anyhow::{Context, Result};
1316
use onecode::{OneFile, OneSchema};
1417
use std::path::Path;
@@ -92,7 +95,7 @@ D Z 1 6 STRING
9295
let schema = OneSchema::from_text(schema_text).context("Failed to create .1aln schema")?;
9396

9497
let mut file = OneFile::open_read(path_str, Some(&schema), Some("aln"), 1)
95-
.context(format!("Failed to open .1aln file: {}", path_str))?;
98+
.context(format!("Failed to open .1aln file: {path_str}"))?;
9699

97100
// Read GDB skeleton to build contig→scaffold mapping
98101
let (contigs, scaffolds) = Self::read_gdb_skeleton(&mut file)?;
@@ -290,8 +293,7 @@ D Z 1 6 STRING
290293
} else {
291294
// DEBUG: This shouldn't happen!
292295
eprintln!(
293-
"[AlnReader] WARNING: No X, M, or D values for alignment at {}..{}",
294-
query_start, query_end
296+
"[AlnReader] WARNING: No X, M, or D values for alignment at {query_start}..{query_end}"
295297
);
296298
0.0
297299
};
@@ -319,7 +321,7 @@ D Z 1 6 STRING
319321
let name = self
320322
.file
321323
.get_sequence_name(query_id)
322-
.unwrap_or_else(|| format!("{}", query_id));
324+
.unwrap_or_else(|| format!("{query_id}"));
323325
(query_id, name, query_len, query_start, query_end)
324326
};
325327

@@ -344,7 +346,7 @@ D Z 1 6 STRING
344346
let name = self
345347
.file
346348
.get_sequence_name(target_id)
347-
.unwrap_or_else(|| format!("{}", target_id));
349+
.unwrap_or_else(|| format!("{target_id}"));
348350
(target_id, name, target_len, target_start, target_end)
349351
};
350352

@@ -443,9 +445,9 @@ pub fn filter_1aln_file_to_paf<P1: AsRef<Path>, P2: AsRef<Path>>(
443445
for (i, aln) in alignments.iter().enumerate() {
444446
let paf_line = aln.to_paf_line();
445447
if i < 3 {
446-
eprintln!("[filter_1aln] Sample PAF line: {}", paf_line);
448+
eprintln!("[filter_1aln] Sample PAF line: {paf_line}");
447449
}
448-
writeln!(writer, "{}", paf_line)?;
450+
writeln!(writer, "{paf_line}")?;
449451
}
450452
writer.flush()?;
451453
}

src/main.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,7 +1098,7 @@ fn align_multiple_fastas(
10981098
if !quiet {
10991099
timing.log(
11001100
"align",
1101-
&format!("Using user-specified frequency threshold: {}", f),
1101+
&format!("Using user-specified frequency threshold: {f}"),
11021102
);
11031103
}
11041104
Some(f)
@@ -1109,8 +1109,7 @@ fn align_multiple_fastas(
11091109
timing.log(
11101110
"align",
11111111
&format!(
1112-
"Setting frequency threshold to {} (number of genome groups)",
1113-
auto_freq
1112+
"Setting frequency threshold to {auto_freq} (number of genome groups)"
11141113
),
11151114
);
11161115
}
@@ -1123,7 +1122,7 @@ fn align_multiple_fastas(
11231122
if !quiet {
11241123
timing.log(
11251124
"align",
1126-
&format!("Aligning {} genomes in single FastGA run", num_genomes),
1125+
&format!("Aligning {num_genomes} genomes in single FastGA run"),
11271126
);
11281127
}
11291128

@@ -1139,7 +1138,7 @@ fn align_multiple_fastas(
11391138
let alignment_count = std::fs::read_to_string(temp_paf.path())?.lines().count();
11401139
timing.log(
11411140
"align",
1142-
&format!("FastGA produced {} alignments", alignment_count),
1141+
&format!("FastGA produced {alignment_count} alignments"),
11431142
);
11441143
}
11451144

0 commit comments

Comments
 (0)