Skip to content

Commit c98b126

Browse files
committed
Cargo clippy fixes
1 parent d4085dd commit c98b126

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

src/compress.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ fn print_sequence_info(sequence_count: usize, assembly_count: usize) {
140140
}
141141

142142

143-
fn build_kmer_graph(k_size: u32, assembly_count: usize, sequences: &Vec<Sequence>) -> KmerGraph {
143+
fn build_kmer_graph(k_size: u32, assembly_count: usize, sequences: &Vec<Sequence>)
144+
-> KmerGraph<'_> {
144145
section_header("Building k-mer De Bruijn graph");
145146
explanation("K-mers in the input sequences are now hashed to make a De Bruijn graph.");
146147
let mut kmer_graph = KmerGraph::new(k_size);

src/trim.rs

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -149,23 +149,19 @@ fn trim_harpin_overlap(graph: &UnitigGraph, sequences: &Vec<Sequence>, weights:
149149
let mut trimmed_start = false;
150150
let mut trimmed_end = false;
151151

152-
let path_2;
153-
let trimmed_path_start = trim_path_hairpin_start(path, weights, min_identity, max_unitigs);
154-
if trimmed_path_start.is_some() {
152+
let path_2 = if let Some(p) = trim_path_hairpin_start(path, weights, min_identity, max_unitigs) {
155153
trimmed_start = true;
156-
path_2 = trimmed_path_start.unwrap();
154+
p
157155
} else {
158-
path_2 = path.clone();
159-
}
156+
path.clone()
157+
};
160158

161-
let path_3;
162-
let trimmed_path_end = trim_path_hairpin_end(&path_2, weights, min_identity, max_unitigs);
163-
if trimmed_path_end.is_some() {
159+
let path_3 = if let Some(p) = trim_path_hairpin_end(&path_2, weights, min_identity, max_unitigs) {
164160
trimmed_end = true;
165-
path_3 = trimmed_path_end.unwrap();
161+
p
166162
} else {
167-
path_3 = path_2;
168-
}
163+
path_2
164+
};
169165

170166
if !trimmed_start && !trimmed_end {
171167
(None, format!("{}: {}", seq, "not trimmed".green()))

0 commit comments

Comments
 (0)