Skip to content

Commit 55ba492

Browse files
refactor: lint
- allow `doc_paragraphs_missing_punctuation` globally - fix `unnecessary_sort_by` in `chain_seeds` (keep descending order via `Reverse`) - fix `multiple_inherent_impl` in `Concat` by merging impl blocks
1 parent 7f3c87f commit 55ba492

3 files changed

Lines changed: 3 additions & 8 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ comparison_chain = "allow"
171171
default_numeric_fallback = "allow"
172172
deref_by_slicing = "allow"
173173
doc_markdown = "allow"
174+
doc_paragraphs_missing_punctuation = "allow"
174175
else_if_without_else = "allow"
175176
exhaustive_enums = "allow"
176177
exhaustive_structs = "allow"

packages/nextclade/src/align/seed_match.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use gcollections::ops::{Intersection, IsEmpty, Union};
1212
use interval::interval_set::{IntervalSet, ToIntervalSet};
1313
use itertools::Itertools;
1414
use std::borrow::Cow;
15-
use std::cmp::{max, min};
15+
use std::cmp::{Reverse, max, min};
1616
use std::collections::{BTreeMap, VecDeque};
1717

1818
/// Copied from https://stackoverflow.com/a/75084739/7483211
@@ -413,7 +413,7 @@ fn chain_seeds(matches: &[SeedMatch2]) -> Vec<SeedMatch2> {
413413
};
414414
triplets.push(added_triplet);
415415
// Sort descending by ref_end
416-
triplets.sort_by(|b, a| a.ref_end.cmp(&b.ref_end));
416+
triplets.sort_by_key(|triplet| Reverse(triplet.ref_end));
417417
triplets.retain(|triplet| triplet.ref_end < added_triplet.ref_end || triplet.score >= added_triplet.score);
418418
}
419419
}

packages/nextclade/src/io/concat.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,7 @@ where
4646
let curr = iter.next();
4747
Concat { iter, curr, delimiter }
4848
}
49-
}
5049

51-
impl<I> Concat<I>
52-
where
53-
I: Iterator,
54-
<I as Iterator>::Item: Read,
55-
{
5650
/// Returns a reference to the item last read, or None if the iterator has been exhausted.
5751
///
5852
/// This is useful for error handling and reporting: if a read operation fails, the reference

0 commit comments

Comments
 (0)