From 3853de8481ff55b5347f3ef6829ddfd90484c8b1 Mon Sep 17 00:00:00 2001 From: Vinzent Steinberg Date: Mon, 8 Jul 2019 17:32:18 +0200 Subject: [PATCH] Fix clippy warnings --- benches/kurtosis.rs | 2 +- benches/mean.rs | 2 +- benches/min.rs | 2 +- src/lib.rs | 2 +- src/moments/mod.rs | 4 ++-- tests/kurtosis.rs | 2 +- tests/macros.rs | 2 +- tests/max.rs | 2 +- tests/mean.rs | 2 +- tests/min.rs | 2 +- tests/moments.rs | 2 +- tests/proptest.rs | 2 +- tests/quantile.rs | 2 +- tests/random.rs | 2 +- tests/skewness.rs | 2 +- tests/streaming_stats.rs | 2 +- tests/weighted_mean.rs | 2 +- 17 files changed, 18 insertions(+), 18 deletions(-) diff --git a/benches/kurtosis.rs b/benches/kurtosis.rs index 80e1f75..7e4935d 100644 --- a/benches/kurtosis.rs +++ b/benches/kurtosis.rs @@ -1,4 +1,4 @@ -#![cfg_attr(feature = "cargo-clippy", allow(float_cmp, map_clone))] +#![cfg_attr(feature = "cargo-clippy", allow(clippy::float_cmp, map_clone))] use bencher::{Bencher, benchmark_group, benchmark_main}; diff --git a/benches/mean.rs b/benches/mean.rs index f50155f..dfd1853 100644 --- a/benches/mean.rs +++ b/benches/mean.rs @@ -1,4 +1,4 @@ -#![cfg_attr(feature = "cargo-clippy", allow(float_cmp, map_clone))] +#![cfg_attr(feature = "cargo-clippy", allow(clippy::float_cmp, map_clone))] use bencher::{Bencher, benchmark_group, benchmark_main}; diff --git a/benches/min.rs b/benches/min.rs index 9f24606..eda717c 100644 --- a/benches/min.rs +++ b/benches/min.rs @@ -1,4 +1,4 @@ -#![cfg_attr(feature = "cargo-clippy", allow(float_cmp, map_clone))] +#![cfg_attr(feature = "cargo-clippy", allow(clippy::float_cmp, map_clone))] use bencher::{Bencher, benchmark_group, benchmark_main}; diff --git a/src/lib.rs b/src/lib.rs index 566dad3..aac5145 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -86,7 +86,7 @@ //! [`Histogram10`]: ./struct.Histogram10.html //! [`Histogram`]: ./trait.Histogram.html -#![cfg_attr(feature = "cargo-clippy", allow(float_cmp))] +#![cfg_attr(feature = "cargo-clippy", allow(clippy::float_cmp))] #![no_std] diff --git a/src/moments/mod.rs b/src/moments/mod.rs index 4678f31..778f3ce 100644 --- a/src/moments/mod.rs +++ b/src/moments/mod.rs @@ -230,7 +230,7 @@ macro_rules! define_moments { let factor_coeff = -delta * over_n; let prev_m = self.m; - for p in 2..(MAX_MOMENT + 1) { + for p in 2..=MAX_MOMENT { term1 *= factor1; term2 *= factor2; coeff_delta *= delta; @@ -266,7 +266,7 @@ macro_rules! define_moments { let mut term_a = n_a * factor_a; let mut term_b = n_b * factor_b; let prev_m = self.m; - for p in 2..(MAX_MOMENT + 1) { + for p in 2..=MAX_MOMENT { term_a *= factor_a; term_b *= factor_b; self.m[p - 2] += other.m[p - 2] + term_a + term_b; diff --git a/tests/kurtosis.rs b/tests/kurtosis.rs index df3c2e0..9185239 100644 --- a/tests/kurtosis.rs +++ b/tests/kurtosis.rs @@ -1,4 +1,4 @@ -#![cfg_attr(feature = "cargo-clippy", allow(float_cmp, map_clone))] +#![cfg_attr(feature = "cargo-clippy", allow(clippy::float_cmp, map_clone))] use core::iter::Iterator; diff --git a/tests/macros.rs b/tests/macros.rs index 3b6e14d..a272e08 100644 --- a/tests/macros.rs +++ b/tests/macros.rs @@ -1,4 +1,4 @@ -#![cfg_attr(feature = "cargo-clippy", allow(float_cmp))] +#![cfg_attr(feature = "cargo-clippy", allow(clippy::float_cmp))] use average::{Estimate, Min, Max, concatenate}; diff --git a/tests/max.rs b/tests/max.rs index 49a67d4..98ef0f8 100644 --- a/tests/max.rs +++ b/tests/max.rs @@ -1,4 +1,4 @@ -#![cfg_attr(feature = "cargo-clippy", allow(float_cmp, map_clone))] +#![cfg_attr(feature = "cargo-clippy", allow(clippy::float_cmp, map_clone))] use core::iter::Iterator; diff --git a/tests/mean.rs b/tests/mean.rs index b3bc05a..8f50c41 100644 --- a/tests/mean.rs +++ b/tests/mean.rs @@ -1,4 +1,4 @@ -#![cfg_attr(feature = "cargo-clippy", allow(float_cmp, map_clone))] +#![cfg_attr(feature = "cargo-clippy", allow(clippy::float_cmp, map_clone))] use core::iter::Iterator; diff --git a/tests/min.rs b/tests/min.rs index 8996d27..935e988 100644 --- a/tests/min.rs +++ b/tests/min.rs @@ -1,4 +1,4 @@ -#![cfg_attr(feature = "cargo-clippy", allow(float_cmp, map_clone))] +#![cfg_attr(feature = "cargo-clippy", allow(clippy::float_cmp, map_clone))] use core::iter::Iterator; diff --git a/tests/moments.rs b/tests/moments.rs index 4e80d2e..d702423 100644 --- a/tests/moments.rs +++ b/tests/moments.rs @@ -1,4 +1,4 @@ -#![cfg_attr(feature = "cargo-clippy", allow(float_cmp, map_clone))] +#![cfg_attr(feature = "cargo-clippy", allow(clippy::float_cmp, map_clone))] use core::iter::Iterator; diff --git a/tests/proptest.rs b/tests/proptest.rs index abd55fe..bd36d5e 100644 --- a/tests/proptest.rs +++ b/tests/proptest.rs @@ -1,4 +1,4 @@ -#![cfg_attr(feature = "cargo-clippy", allow(float_cmp, map_clone))] +#![cfg_attr(feature = "cargo-clippy", allow(clippy::float_cmp, map_clone))] use core::iter::Iterator; diff --git a/tests/quantile.rs b/tests/quantile.rs index 698ad0e..cdd5816 100644 --- a/tests/quantile.rs +++ b/tests/quantile.rs @@ -1,4 +1,4 @@ -#![cfg_attr(feature = "cargo-clippy", allow(float_cmp, map_clone))] +#![cfg_attr(feature = "cargo-clippy", allow(clippy::float_cmp, map_clone))] use average::{Estimate, Quantile}; use quantiles::ckms::CKMS; diff --git a/tests/random.rs b/tests/random.rs index 2a0cce8..f4d4b29 100644 --- a/tests/random.rs +++ b/tests/random.rs @@ -1,4 +1,4 @@ -#![cfg_attr(feature = "cargo-clippy", allow(float_cmp, map_clone))] +#![cfg_attr(feature = "cargo-clippy", allow(clippy::float_cmp, map_clone))] use rand_distr::Distribution; diff --git a/tests/skewness.rs b/tests/skewness.rs index 2d693b4..39e6f70 100644 --- a/tests/skewness.rs +++ b/tests/skewness.rs @@ -1,4 +1,4 @@ -#![cfg_attr(feature = "cargo-clippy", allow(float_cmp, map_clone))] +#![cfg_attr(feature = "cargo-clippy", allow(clippy::float_cmp, map_clone))] use core::iter::Iterator; diff --git a/tests/streaming_stats.rs b/tests/streaming_stats.rs index 0179129..e52cbb7 100644 --- a/tests/streaming_stats.rs +++ b/tests/streaming_stats.rs @@ -1,4 +1,4 @@ -#![cfg_attr(feature = "cargo-clippy", allow(float_cmp, map_clone))] +#![cfg_attr(feature = "cargo-clippy", allow(clippy::float_cmp, map_clone))] use average::assert_almost_eq; diff --git a/tests/weighted_mean.rs b/tests/weighted_mean.rs index a705bf6..d0e3be8 100644 --- a/tests/weighted_mean.rs +++ b/tests/weighted_mean.rs @@ -1,4 +1,4 @@ -#![cfg_attr(feature = "cargo-clippy", allow(float_cmp, map_clone))] +#![cfg_attr(feature = "cargo-clippy", allow(clippy::float_cmp, map_clone))] use core::iter::Iterator;