From e03d2e9761eecab4d40024d90cc12b3e158ffefe Mon Sep 17 00:00:00 2001 From: Luiz Irber Date: Wed, 8 Jul 2020 09:00:49 -0700 Subject: [PATCH] bump needletail --- src/core/Cargo.toml | 4 ++-- src/core/src/index/linear.rs | 2 +- src/core/src/index/sbt/mod.rs | 2 +- src/core/src/signature.rs | 19 ++++++++----------- src/core/src/sketch/nodegraph.rs | 2 +- 5 files changed, 13 insertions(+), 16 deletions(-) diff --git a/src/core/Cargo.toml b/src/core/Cargo.toml index 1ef2a83256..4b1f084b74 100644 --- a/src/core/Cargo.toml +++ b/src/core/Cargo.toml @@ -31,7 +31,7 @@ fixedbitset = "0.3.0" log = "0.4.8" md5 = "0.7.0" murmurhash3 = "0.0.5" -niffler = { version = "3.0.0", default-features = false, features = [ "gz" ], git = "https://github.com/luizirber/niffler.git", branch = "send" } +niffler = { version = "2.2.0", default-features = false, features = [ "gz" ] } nohash-hasher = "0.2.0" once_cell = "1.3.1" rayon = { version = "1.3.0", optional = true } @@ -61,7 +61,7 @@ rand = "0.7.3" tempfile = "3.1.0" [dev-dependencies.needletail] -version = "0.3.2" +version = "0.4.0" default-features = false [[bench]] diff --git a/src/core/src/index/linear.rs b/src/core/src/index/linear.rs index 0cc627f185..009ebbaadc 100644 --- a/src/core/src/index/linear.rs +++ b/src/core/src/index/linear.rs @@ -153,7 +153,7 @@ where pub fn from_reader(rdr: R, path: P) -> Result, Error> where - R: Read + Send, + R: Read, P: AsRef, { // TODO: check https://serde.rs/enum-representations.html for a diff --git a/src/core/src/index/sbt/mod.rs b/src/core/src/index/sbt/mod.rs index dc8f13d17b..d8e3d2c240 100644 --- a/src/core/src/index/sbt/mod.rs +++ b/src/core/src/index/sbt/mod.rs @@ -137,7 +137,7 @@ where pub fn from_reader(mut rdr: R, path: P) -> Result, T>, Error> where - R: Read + Send, + R: Read, P: AsRef, { // TODO: I would love to do this, but I get an untagged enum error with diff --git a/src/core/src/signature.rs b/src/core/src/signature.rs index e9e5cab6c2..b8c7be11b2 100644 --- a/src/core/src/signature.rs +++ b/src/core/src/signature.rs @@ -229,7 +229,7 @@ impl Signature { pub fn from_reader(rdr: R) -> Result, Error> where - R: io::Read + Send, + R: io::Read, { let (rdr, _format) = niffler::get_reader(Box::new(rdr))?; @@ -244,7 +244,7 @@ impl Signature { _scaled: Option, ) -> Result, Error> where - R: io::Read + Send, + R: io::Read, { let orig_sigs = Signature::from_reader(buf)?; @@ -426,7 +426,7 @@ mod test { use std::io::{BufReader, Read}; use std::path::PathBuf; - use needletail::parse_sequence_reader; + use needletail::parse_fastx_reader; use crate::cmd::ComputeParameters; use crate::signature::SigsTrait; @@ -559,14 +559,11 @@ mod test { let mut f = File::open("../../tests/test-data/ecoli.genes.fna").unwrap(); let _ = f.read_to_end(&mut data); - parse_sequence_reader( - &data[..], - |_| {}, - |rec| { - sig.add_sequence(&rec.seq, false).unwrap(); - }, - ) - .unwrap(); + let mut parser = parse_fastx_reader(&data[..]).unwrap(); + while let Some(record) = parser.next() { + let record = record.unwrap(); + sig.add_sequence(&record.seq(), false).unwrap(); + } let sketches = sig.sketches(); assert_eq!(sketches.len(), 12); diff --git a/src/core/src/sketch/nodegraph.rs b/src/core/src/sketch/nodegraph.rs index 059533de8a..34a34a8ca3 100644 --- a/src/core/src/sketch/nodegraph.rs +++ b/src/core/src/sketch/nodegraph.rs @@ -218,7 +218,7 @@ impl Nodegraph { pub fn from_reader(rdr: R) -> Result where - R: io::Read + Send, + R: io::Read, { let (mut rdr, _format) = niffler::get_reader(Box::new(rdr))?;