diff --git a/README.md b/README.md index 78b6cee9..75ec6320 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ A goal of this library is to enable composition of these algorithms; for example Run your application with `RUSTFLAGS="-C target-cpu=native"` to benefit from the SIMD-acceleration like so: ```bash - RUSTFLAGS="-C target-cpu=native" cargo run --release +RUSTFLAGS="-C target-cpu=native" cargo run --release ``` See [this gist](https://gist.github.com/debasishg/8172796) for a good list of further algorithms to be implemented. Other resources are [Probabilistic data structures – Wikipedia](https://en.wikipedia.org/wiki/Category:Probabilistic_data_structures), [DataSketches – A similar Java library originating at Yahoo](https://datasketches.github.io/), and [Algebird – A similar Java library originating at Twitter](https://github.com/twitter/algebird). diff --git a/src/count_min.rs b/src/count_min.rs index 70247081..1fe70dcd 100644 --- a/src/count_min.rs +++ b/src/count_min.rs @@ -89,7 +89,8 @@ where .iter() .enumerate() .map(|(k_i, &offset)| &self.counters[k_i][offset]), - ).unwrap(); + ) + .unwrap(); lowest += value; self.counters .iter_mut() @@ -108,7 +109,8 @@ where counters[offset] += value; &counters[offset] }), - ).unwrap() + ) + .unwrap() } } @@ -138,7 +140,8 @@ where .iter() .zip(self.offsets(key)) .map(|(counters, offset)| &counters[offset]), - ).unwrap() + ) + .unwrap() } // pub fn estimate_memory( diff --git a/src/lib.rs b/src/lib.rs index a84850ca..66012045 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -14,7 +14,7 @@ //! Run your application with `RUSTFLAGS="-C target-cpu=native"` to benefit from the SIMD-acceleration like so: //! //! ```bash -//! RUSTFLAGS="-C target-cpu=native" cargo run --release +//! RUSTFLAGS="-C target-cpu=native" cargo run --release //! ``` //! //! See [this gist](https://gist.github.com/debasishg/8172796) for a good list of further algorithms to be implemented. Other resources are [Probabilistic data structures – Wikipedia](https://en.wikipedia.org/wiki/Category:Probabilistic_data_structures), [DataSketches – A similar Java library originating at Yahoo](https://datasketches.github.io/), and [Algebird – A similar Java library originating at Twitter](https://github.com/twitter/algebird). @@ -22,15 +22,7 @@ //! As these implementations are often in hot code paths, unsafe is used, albeit only when necessary to a) achieve the asymptotically optimal algorithm or b) mitigate an observed bottleneck. #![doc(html_root_url = "https://docs.rs/streaming_algorithms/0.1.0")] -#![feature( - nll, - tool_lints, - non_modrs_mods, - specialization, - stdsimd, - mmx_target_feature, - convert_id -)] +#![feature(nll, specialization, convert_id)] #![warn( missing_copy_implementations, missing_debug_implementations, @@ -40,10 +32,11 @@ unused_import_braces, unused_qualifications, unused_results, -)] // from https://github.com/rust-unofficial/patterns/blob/master/anti_patterns/deny-warnings.md -#![allow(dead_code, stable_features)] -#![warn(clippy::pedantic)] + clippy::pedantic +)] +// from https://github.com/rust-unofficial/patterns/blob/master/anti_patterns/deny-warnings.md #![allow( + dead_code, clippy::doc_markdown, clippy::inline_always, clippy::stutter, @@ -54,7 +47,7 @@ clippy::cast_sign_loss, clippy::cast_precision_loss, clippy::cast_lossless, - clippy::float_cmp, + clippy::float_cmp )] extern crate twox_hash; diff --git a/src/linked_list.rs b/src/linked_list.rs index 7394ad89..b9dd0598 100644 --- a/src/linked_list.rs +++ b/src/linked_list.rs @@ -28,7 +28,8 @@ impl LinkedList { (0..cap) .map(|_| (usize::max_value(), usize::max_value(), None)) .collect::>() - }.into_boxed_slice(); + } + .into_boxed_slice(); let ret = Self { vec, head: usize::max_value(),