Skip to content

Commit

Permalink
Merge pull request #36 from suchapalaver/fix/fix-updated-rust-clippy-…
Browse files Browse the repository at this point in the history
…warnings

fix unnecessary 'into_iter' clippy warnings
  • Loading branch information
suchapalaver authored Sep 24, 2023
2 parents b95e572 + 9c0453f commit 60eaa00
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/kmer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ impl Kmer {

pub(crate) fn unpack(&mut self, k: usize) {
self.bytes = (0..k)
.into_iter()
.map(|i| self.packed_bits << ((i * 2) + 64 - (k * 2)) >> 62)
.map(ByteConversion::from_u64)
.collect()
Expand Down
6 changes: 2 additions & 4 deletions src/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ use rayon::{prelude::IntoParallelIterator, vec::IntoIter};
pub(crate) fn read<P: AsRef<Path> + Debug>(path: P) -> Result<IntoIter<Bytes>, Box<dyn Error>> {
Ok(bio::io::fasta::Reader::from_file(path)?
.records()
.into_iter()
.map(|read| read.expect("Error reading fasta record."))
.map(|read| read.expect("Error reading FASTA record."))
.map(|record| Bytes::copy_from_slice(record.seq()))
.collect::<Vec<Bytes>>()
.into_par_iter())
Expand All @@ -20,8 +19,7 @@ pub(crate) fn read<P: AsRef<Path> + Debug>(path: P) -> Result<IntoIter<Bytes>, B
let mut v = Vec::new();
while let Some(record) = reader.next() {
let record = record.expect("invalid record");
let seq = record.seq();
let seq = Bytes::copy_from_slice(&seq);
let seq = Bytes::copy_from_slice(&record.seq());
v.push(seq);
}
Ok(v.into_par_iter())
Expand Down

0 comments on commit 60eaa00

Please sign in to comment.