From ca40809f852f384953f638d877cc0f61c03ea962 Mon Sep 17 00:00:00 2001 From: Luiz Irber Date: Wed, 24 Jun 2020 12:20:26 -0700 Subject: [PATCH] fix lints and msrv (older backtrace crate) --- src/core/Cargo.toml | 1 + src/core/src/sketch/minhash.rs | 8 +++----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/core/Cargo.toml b/src/core/Cargo.toml index 7b93309992..b6123105c7 100644 --- a/src/core/Cargo.toml +++ b/src/core/Cargo.toml @@ -25,6 +25,7 @@ parallel = ["rayon"] #cbindgen = "~0.14.2" [dependencies] +backtrace = "=0.3.46" # later versions require rust 1.40 byteorder = "1.3.4" cfg-if = "0.1.10" failure = "0.1.8" diff --git a/src/core/src/sketch/minhash.rs b/src/core/src/sketch/minhash.rs index ccfd0b4499..8af0ffb453 100644 --- a/src/core/src/sketch/minhash.rs +++ b/src/core/src/sketch/minhash.rs @@ -1476,10 +1476,8 @@ impl KmerMinHashBTree { { // "good" hash - within range, smaller than current entry, or // still have space available - if self.mins.insert(hash) { - if hash > self.current_max { - self.current_max = hash; - } + if self.mins.insert(hash) && hash > self.current_max { + self.current_max = hash; } if let Some(ref mut abunds) = self.abunds { *abunds.entry(hash).or_insert(0) += abundance; @@ -1530,7 +1528,7 @@ impl KmerMinHashBTree { self.num as usize }; - self.mins = union.into_iter().take(to_take).cloned().collect(); + self.mins = union.take(to_take).cloned().collect(); if let Some(abunds) = &self.abunds { if let Some(oabunds) = &other.abunds {