Skip to content

Commit 5e0b267

Browse files
committed
remove specialization and have a non-simd fallback for stable
1 parent f8038f5 commit 5e0b267

File tree

7 files changed

+229
-162
lines changed

7 files changed

+229
-162
lines changed

Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@ edition = "2018"
1818
azure-devops = { project = "alecmocatta/streaming_algorithms", pipeline = "tests", build = "16" }
1919
maintenance = { status = "actively-developed" }
2020

21+
[features]
22+
nightly = ["packed_simd"]
23+
2124
[dependencies]
2225
twox-hash = "1.1"
2326
serde = { version = "1.0", features = ["derive"] }
2427
rand = { version = "0.7", features = ["small_rng"] }
25-
packed_simd = { version = "0.3", features = ["into_bits"] }
28+
packed_simd = { version = "0.3", features = ["into_bits"], optional = true }

src/count_min.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,15 @@
2020
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121
// SOFTWARE.
2222

23-
use super::f64_to_usize;
24-
use crate::traits::{Intersect, IntersectPlusUnionIsPlus, New, UnionAssign};
2523
use serde::{Deserialize, Serialize};
2624
use std::{
2725
borrow::Borrow, cmp::max, convert::TryFrom, fmt, hash::{Hash, Hasher}, marker::PhantomData, ops
2826
};
2927
use twox_hash::XxHash;
3028

29+
use super::f64_to_usize;
30+
use crate::traits::{Intersect, IntersectPlusUnionIsPlus, New, UnionAssign};
31+
3132
/// An implementation of a [count-min sketch](https://en.wikipedia.org/wiki/Count–min_sketch) data structure with *conservative updating* for increased accuracy.
3233
///
3334
/// This data structure is also known as a [counting Bloom filter](https://en.wikipedia.org/wiki/Bloom_filter#Counting_filters).
@@ -75,7 +76,7 @@ where
7576
where
7677
Q: Hash,
7778
K: Borrow<Q>,
78-
C: for<'a> ops::AddAssign<&'a V>,
79+
C: for<'a> ops::AddAssign<&'a V> + IntersectPlusUnionIsPlus,
7980
{
8081
if !<C as IntersectPlusUnionIsPlus>::VAL {
8182
let offsets = self.offsets(key);

0 commit comments

Comments
 (0)