Skip to content

Commit

Permalink
Use the new RLE return type in find.
Browse files Browse the repository at this point in the history
  • Loading branch information
tmaklin committed Nov 4, 2024
1 parent 3ae23ed commit 3daea1b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/cli/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,16 @@ fn main() {
let seq = seqrec.normalize(true);

// Get local alignments for forward strand
res = kbo::find(&seq, &sbwt, &lcs, derand_opts.clone()).iter().map(|x| (x.0, x.1, '+', x.2 + x.3, x.3, ref_contig.clone(), query_contig.to_string().clone())).collect();
res = kbo::find(&seq, &sbwt, &lcs, derand_opts.clone())

Check warning on line 190 in src/cli/main.rs

View workflow job for this annotation

GitHub Actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/cli/main.rs:190:36 | 190 | res = kbo::find(&seq, &sbwt, &lcs, derand_opts.clone()) | ^^^^ help: change this to: `lcs` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 190 in src/cli/main.rs

View workflow job for this annotation

GitHub Actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/cli/main.rs:190:29 | 190 | res = kbo::find(&seq, &sbwt, &lcs, derand_opts.clone()) | ^^^^^ help: change this to: `sbwt` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow = note: `#[warn(clippy::needless_borrow)]` on by default
.iter()
.map(|x| (x.start, x.end, '+', x.matches + x.mismatches + x.jumps + x.gap_bases, x.mismatches,
ref_contig.clone(), query_contig.to_string().clone())).collect();

// Add local alignments for reverse _complement
res.append(&mut kbo::find(&seq.reverse_complement(), &sbwt, &lcs, derand_opts.clone()).iter().map(|x| (x.0, x.1, '-', x.2 + x.3, x.3, ref_contig.clone(), query_contig.to_string().clone())).collect());
res.append(&mut kbo::find(&seq.reverse_complement(), &sbwt, &lcs, derand_opts.clone())

Check warning on line 196 in src/cli/main.rs

View workflow job for this annotation

GitHub Actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/cli/main.rs:196:67 | 196 | res.append(&mut kbo::find(&seq.reverse_complement(), &sbwt, &lcs, derand_opts.clone()) | ^^^^ help: change this to: `lcs` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 196 in src/cli/main.rs

View workflow job for this annotation

GitHub Actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/cli/main.rs:196:60 | 196 | res.append(&mut kbo::find(&seq.reverse_complement(), &sbwt, &lcs, derand_opts.clone()) | ^^^^^ help: change this to: `sbwt` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
.iter()
.map(|x| (x.start, x.end, '+', x.matches + x.mismatches + x.jumps + x.gap_bases, x.mismatches,
ref_contig.clone(), query_contig.to_string().clone())).collect());
}
res
}).flatten().collect();
Expand Down

0 comments on commit 3daea1b

Please sign in to comment.