diff --git a/src/core/src/collection.rs b/src/core/src/collection.rs index 8cc6129cf4..9f708381ef 100644 --- a/src/core/src/collection.rs +++ b/src/core/src/collection.rs @@ -6,8 +6,7 @@ use camino::Utf8PathBuf as PathBuf; use crate::encodings::Idx; use crate::manifest::{Manifest, Record}; use crate::prelude::*; -use crate::signature::Signature; -use crate::storage::{FSStorage, InnerStorage, MemStorage, SigStore, Storage, ZipStorage}; +use crate::storage::{FSStorage, InnerStorage, MemStorage, SigStore, ZipStorage}; use crate::{Error, Result}; #[cfg(feature = "parallel")] diff --git a/src/core/src/encodings.rs b/src/core/src/encodings.rs index ac69cd58eb..f8934596dc 100644 --- a/src/core/src/encodings.rs +++ b/src/core/src/encodings.rs @@ -1,8 +1,6 @@ use serde::{Deserialize, Serialize}; use std::collections::HashMap; -use std::convert::TryFrom; use std::hash::{BuildHasher, BuildHasherDefault, Hash, Hasher}; -use std::iter::Iterator; use std::str; use nohash_hasher::BuildNoHashHasher; diff --git a/src/core/src/manifest.rs b/src/core/src/manifest.rs index c82ca6ee1e..7441a9b69f 100644 --- a/src/core/src/manifest.rs +++ b/src/core/src/manifest.rs @@ -1,4 +1,3 @@ -use std::convert::TryInto; use std::fs::File; use std::io::{BufRead, BufReader, Read, Write}; use std::ops::Deref; @@ -12,7 +11,7 @@ use serde::{Deserialize, Serialize}; use crate::encodings::HashFunctions; use crate::prelude::*; -use crate::signature::{Signature, SigsTrait}; +use crate::signature::SigsTrait; use crate::sketch::Sketch; use crate::Result; diff --git a/src/core/src/signature.rs b/src/core/src/signature.rs index da38587dc3..0ab8190f98 100644 --- a/src/core/src/signature.rs +++ b/src/core/src/signature.rs @@ -6,7 +6,6 @@ use core::iter::FusedIterator; use std::fs::File; use std::io; -use std::iter::Iterator; use std::path::Path; use std::str; @@ -18,7 +17,6 @@ use typed_builder::TypedBuilder; use crate::encodings::{aa_to_dayhoff, aa_to_hp, revcomp, to_aa, HashFunctions, VALID}; use crate::prelude::*; -use crate::selection::{Select, Selection}; use crate::sketch::minhash::KmerMinHash; use crate::sketch::Sketch; use crate::Error; @@ -891,7 +889,6 @@ impl PartialEq for Signature { #[cfg(test)] mod test { - use std::convert::TryInto; use std::fs::File; use std::io::{BufReader, Read}; use std::path::PathBuf; diff --git a/src/core/src/sketch/minhash.rs b/src/core/src/sketch/minhash.rs index 24cdc9539f..1ee747745a 100644 --- a/src/core/src/sketch/minhash.rs +++ b/src/core/src/sketch/minhash.rs @@ -2,7 +2,7 @@ use std::cmp::Ordering; use std::collections::{BTreeMap, BTreeSet}; use std::f64::consts::PI; use std::fmt::Write; -use std::iter::{Iterator, Peekable}; +use std::iter::Peekable; use std::str; use std::sync::Mutex; @@ -942,56 +942,6 @@ impl> Iterator for Intersection { } } -struct Union> { - iter: Peekable, - other: Peekable, -} - -impl> Iterator for Union { - type Item = T; - - fn next(&mut self) -> Option { - let res = match (self.iter.peek(), self.other.peek()) { - (Some(ref left_key), Some(ref right_key)) => left_key.cmp(right_key), - (None, Some(_)) => { - return self.other.next(); - } - (Some(_), None) => { - return self.iter.next(); - } - _ => return None, - }; - - match res { - Ordering::Less => self.iter.next(), - Ordering::Greater => self.other.next(), - Ordering::Equal => { - self.other.next(); - self.iter.next() - } - } - } -} - -#[cfg(test)] -mod test { - use super::Union; - - #[test] - fn test_union() { - let v1 = [1u64, 2, 4, 10]; - let v2 = [1u64, 3, 4, 9]; - - let union: Vec = Union { - iter: v1.iter().peekable(), - other: v2.iter().peekable(), - } - .cloned() - .collect(); - assert_eq!(union, [1, 2, 3, 4, 9, 10]); - } -} - //############# // A MinHash implementation for low scaled or large cardinalities