From b20dda23079a11f64e58babc08386bde20f7d106 Mon Sep 17 00:00:00 2001 From: gifnksm Date: Thu, 27 Nov 2014 23:06:06 +0900 Subject: [PATCH] Update to iter stabilization. `AdditiveIterator::sum` and `MultiplicativeIterator::product` now take bare self. --- src/bigint.rs | 8 ++++---- src/complex.rs | 4 ++-- src/rational.rs | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/bigint.rs b/src/bigint.rs index 066aeab..0952895 100644 --- a/src/bigint.rs +++ b/src/bigint.rs @@ -740,14 +740,14 @@ impl FromStrRadix for BigUint { } impl> AdditiveIterator for T { - fn sum(&mut self) -> BigUint { + fn sum(self) -> BigUint { let init: BigUint = Zero::zero(); self.fold(init, |acc, x| acc + x) } } impl> MultiplicativeIterator for T { - fn product(&mut self) -> BigUint { + fn product(self) -> BigUint { let init: BigUint = One::one(); self.fold(init, |acc, x| acc * x) } @@ -1388,14 +1388,14 @@ impl RandBigInt for R { } impl> AdditiveIterator for T { - fn sum(&mut self) -> BigInt { + fn sum(self) -> BigInt { let init: BigInt = Zero::zero(); self.fold(init, |acc, x| acc + x) } } impl> MultiplicativeIterator for T { - fn product(&mut self) -> BigInt { + fn product(self) -> BigInt { let init: BigInt = One::one(); self.fold(init, |acc, x| acc * x) } diff --git a/src/complex.rs b/src/complex.rs index 7a63c0b..b5f7157 100644 --- a/src/complex.rs +++ b/src/complex.rs @@ -176,14 +176,14 @@ impl fmt::Show for Complex { } impl>> AdditiveIterator> for T { - fn sum(&mut self) -> Complex { + fn sum(self) -> Complex { let init: Complex = Zero::zero(); self.fold(init, |acc, x| acc + x) } } impl>> MultiplicativeIterator> for T { - fn product(&mut self) -> Complex { + fn product(self) -> Complex { let init: Complex = One::one(); self.fold(init, |acc, x| acc * x) } diff --git a/src/rational.rs b/src/rational.rs index 14831c5..a094d60 100644 --- a/src/rational.rs +++ b/src/rational.rs @@ -384,14 +384,14 @@ impl } impl>> AdditiveIterator> for T { - fn sum(&mut self) -> Ratio { + fn sum(self) -> Ratio { let init: Ratio = Zero::zero(); self.fold(init, |acc, x| acc + x) } } impl>> MultiplicativeIterator> for T { - fn product(&mut self) -> Ratio { + fn product(self) -> Ratio { let init: Ratio = One::one(); self.fold(init, |acc, x| acc * x) }