Skip to content

Commit c5ca94b

Browse files
committed
fix clippy and make tests CI-ready
1 parent ad4280a commit c5ca94b

3 files changed

Lines changed: 20 additions & 25 deletions

File tree

src/select.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ fn best_chain_one_strand(
182182
continue;
183183
}
184184
for c58 in &s58e {
185-
if !(b.ivl.start < c58.ivl.start) {
185+
if b.ivl.start >= c58.ivl.start {
186186
continue;
187187
}
188188
for d in &lsu {

src/tblout.rs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,6 @@ pub struct TopKHits {
106106
}
107107

108108
impl TopKHits {
109-
pub fn new() -> Self {
110-
Self {
111-
bins: std::array::from_fn(|_| Vec::new()),
112-
}
113-
}
114-
115109
/// Compatibility helper: gather all stored hits into one small Vec
116110
/// (max size = 8 * K).
117111
pub fn flatten(&self) -> Vec<TblHit> {
@@ -165,10 +159,10 @@ pub fn stream_topk_tblout(
165159
};
166160
total_tblout_hits += 1;
167161

168-
if let Some(cut) = evalue_cutoff {
169-
if hit.evalue > cut {
170-
continue;
171-
}
162+
if let Some(cut) = evalue_cutoff
163+
&& hit.evalue > cut
164+
{
165+
continue;
172166
}
173167

174168
let Some(anchor) = select::classify(&hit.model) else {
@@ -179,7 +173,8 @@ pub fn stream_topk_tblout(
179173
let rid = hit.read_id.clone();
180174
let idx = bin_index(anchor, hit.strand);
181175

182-
let entry = map.entry(rid).or_insert_with(TopKHits::new);
176+
let entry = map.entry(rid).or_default();
177+
183178
push_topk(&mut entry.bins[idx], hit, k);
184179
}
185180

src/trim.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -265,19 +265,19 @@ pub fn trim_all(
265265
let mut wrote = false;
266266

267267
for (i, maybe_plan) in plan_array.iter().enumerate() {
268-
if let Some(plan) = maybe_plan {
269-
if let Some((out_seq, out_qual)) = extract_trimmed(&rec, plan) {
270-
let out_id = trimmed_id(&rec.id, outputs[i].tag, plan);
271-
outputs[i]
272-
.writer
273-
.write_record(&out_id, &out_seq, out_qual.as_deref())?;
274-
wrote = true;
275-
match i {
276-
0 => stats.kept_full += 1,
277-
1 => stats.kept_its1 += 1,
278-
2 => stats.kept_its2 += 1,
279-
_ => unreachable!(),
280-
}
268+
if let Some(plan) = maybe_plan
269+
&& let Some((out_seq, out_qual)) = extract_trimmed(&rec, plan)
270+
{
271+
let out_id = trimmed_id(&rec.id, outputs[i].tag, plan);
272+
outputs[i]
273+
.writer
274+
.write_record(&out_id, &out_seq, out_qual.as_deref())?;
275+
wrote = true;
276+
match i {
277+
0 => stats.kept_full += 1,
278+
1 => stats.kept_its1 += 1,
279+
2 => stats.kept_its2 += 1,
280+
_ => unreachable!(),
281281
}
282282
}
283283
}

0 commit comments

Comments
 (0)