diff --git a/CHANGELOG.md b/CHANGELOG.md index f34a95a..dd40082 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.6.1](https://github.com/pmcgleenon/heavykeeper-rs/compare/v0.6.0...v0.6.1) - 2025-09-02 + +### Other + +- added Sync to rng +- Merge pull request #52 from pmcgleenon/dependabot/cargo/criterion-0.7.0 + ## [0.6.0](https://github.com/pmcgleenon/heavykeeper-rs/compare/v0.5.1...v0.6.0) - 2025-07-27 ### Other diff --git a/Cargo.toml b/Cargo.toml index 6a365e2..e82f6e8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "heavykeeper" -version = "0.6.0" +version = "0.6.1" edition = "2021" authors = [ "Patrick McGleenon"] description = "HeavyKeeper is for finding Top-K elephant flows with high precision and low memory footprint." diff --git a/src/heavykeeper.rs b/src/heavykeeper.rs index 56a322d..837adf3 100644 --- a/src/heavykeeper.rs +++ b/src/heavykeeper.rs @@ -75,7 +75,7 @@ pub struct TopK { buckets: Vec>, priority_queue: TopKQueue, hasher: RandomState, - random: Box, + random: Box, } pub struct Builder { @@ -85,7 +85,7 @@ pub struct Builder { decay: Option, seed: Option, hasher: Option, - rng: Option>, + rng: Option>, _phantom: std::marker::PhantomData, } @@ -133,6 +133,7 @@ impl TopK { ) } +<<<<<<< HEAD fn with_components( k: usize, width: usize, @@ -141,6 +142,9 @@ impl TopK { hasher: RandomState, rng: Box, ) -> Self { +======= + fn with_components(k: usize, width: usize, depth: usize, decay: f64, hasher: RandomState, rng: Box) -> Self { +>>>>>>> origin/main // Pre-allocate with capacity to avoid resizing let mut buckets = Vec::with_capacity(depth); for _ in 0..depth { @@ -430,6 +434,12 @@ impl Default for Builder { } } +impl Default for Builder { + fn default() -> Self { + Self::new() + } +} + impl Builder { pub fn new() -> Self { Self { @@ -474,7 +484,7 @@ impl Builder { self } - pub fn rng(mut self, rng: R) -> Self { + pub fn rng(mut self, rng: R) -> Self { self.rng = Some(Box::new(rng)); self }