From 68a4fa64cb55767aac9516c97a5ddf9923656046 Mon Sep 17 00:00:00 2001 From: Vinzent Steinberg Date: Fri, 12 Jan 2018 14:23:38 +0100 Subject: [PATCH] Restore compatibility with stable --- src/lib.rs | 1 - src/moments/mod.rs | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 93191c9..a857c05 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -70,7 +70,6 @@ //! [`Min`]: ./struct.Min.html //! [`Max`]: ./struct.Max.html //! [`concatenate`]: ./macro.concatenate.html -#![feature(inclusive_range_syntax)] #![cfg_attr(feature = "cargo-clippy", allow(float_cmp))] diff --git a/src/moments/mod.rs b/src/moments/mod.rs index f120c9c..eda328c 100644 --- a/src/moments/mod.rs +++ b/src/moments/mod.rs @@ -129,7 +129,7 @@ impl Moments { let factor_coeff = -delta * over_n; let prev_m = self.m; - for p in 2..=MAX_P { + for p in 2..(MAX_P + 1) { term1 *= factor1; term2 *= factor2; coeff_delta *= delta; @@ -138,7 +138,7 @@ impl Moments { let mut coeff = 1.; let mut binom = IterBinomial::new(p as u64); binom.next().unwrap(); // Skip k = 0. - for k in 1..=(p - 2) { + for k in 1..(p - 1) { coeff *= factor_coeff; self.m[p - 2] += f64::approx_from(binom.next().unwrap()).unwrap() * prev_m[p - 2 - k] * coeff; @@ -165,7 +165,7 @@ impl Merge for 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_P { + for p in 2..(MAX_P + 1) { term_a *= factor_a; term_b *= factor_b; self.m[p - 2] += other.m[p - 2] + term_a + term_b; @@ -175,7 +175,7 @@ impl Merge for Moments { let mut coeff_delta = 1.; let mut binom = IterBinomial::new(p); binom.next().unwrap(); - for k in 1..=(p - 2) { + for k in 1..(p - 1) { coeff_a *= -n_b_over_n; coeff_b *= n_a_over_n; coeff_delta *= delta;