From bfa91ee92a39adc346600e4eb3e8b46d321d56ff Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 7 Jan 2015 12:09:44 -0800 Subject: [PATCH] Bump to 0.1.6 --- Cargo.toml | 2 +- src/bigint.rs | 29 ----------------------------- src/complex.rs | 25 +++---------------------- src/lib.rs | 5 ----- src/rational.rs | 20 -------------------- 5 files changed, 4 insertions(+), 77 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e3950eb..6904e4b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "num" -version = "0.1.5" +version = "0.1.6" authors = ["The Rust Project Developers"] license = "MIT/Apache-2.0" homepage = "https://github.com/rust-lang/num" diff --git a/src/bigint.rs b/src/bigint.rs index 5af89d4..e847588 100644 --- a/src/bigint.rs +++ b/src/bigint.rs @@ -59,7 +59,6 @@ use Integer; use std::default::Default; use std::iter::repeat; -use std::iter::{AdditiveIterator, MultiplicativeIterator}; use std::num::FromStrRadix; use std::num::{Int, ToPrimitive, FromPrimitive}; use std::ops::{Add, BitAnd, BitOr, BitXor, Div, Mul, Neg, Rem, Shl, Shr, Sub}; @@ -852,20 +851,6 @@ impl FromStrRadix for BigUint { } } -impl> AdditiveIterator for T { - fn sum(self) -> BigUint { - let init: BigUint = Zero::zero(); - self.fold(init, |acc, x| acc + x) - } -} - -impl> MultiplicativeIterator for T { - fn product(self) -> BigUint { - let init: BigUint = One::one(); - self.fold(init, |acc, x| acc * x) - } -} - impl BigUint { /// Creates and initializes a `BigUint`. /// @@ -1554,20 +1539,6 @@ impl RandBigInt for R { } } -impl> AdditiveIterator for T { - fn sum(self) -> BigInt { - let init: BigInt = Zero::zero(); - self.fold(init, |acc, x| acc + x) - } -} - -impl> MultiplicativeIterator for T { - fn product(self) -> BigInt { - let init: BigInt = One::one(); - self.fold(init, |acc, x| acc * x) - } -} - impl BigInt { /// Creates and initializes a BigInt. /// diff --git a/src/complex.rs b/src/complex.rs index b079a20..abac2bd 100644 --- a/src/complex.rs +++ b/src/complex.rs @@ -12,8 +12,7 @@ //! Complex numbers. use std::fmt; -use std::num::FloatMath; -use std::iter::{AdditiveIterator, MultiplicativeIterator}; +use std::num::Float; use std::ops::{Add, Div, Mul, Neg, Sub}; use {Zero, One, Num}; @@ -76,7 +75,7 @@ impl Complex { } } -impl Complex { +impl Complex { /// Calculate |self| #[inline] pub fn norm(&self) -> T { @@ -84,7 +83,7 @@ impl Complex { } } -impl Complex { +impl Complex { /// Calculate the principal Arg of self. #[inline] pub fn arg(&self) -> T { @@ -252,24 +251,6 @@ impl fmt::Show for Complex { } } -impl AdditiveIterator> for T - where A: Clone + Num, T: Iterator> -{ - fn sum(self) -> Complex { - let init: Complex = Zero::zero(); - self.fold(init, |acc, x| acc + x) - } -} - -impl MultiplicativeIterator> for T - where A: Clone + Num, T: Iterator> -{ - fn product(self) -> Complex { - let init: Complex = One::one(); - self.fold(init, |acc, x| acc * x) - } -} - #[cfg(test)] mod test { #![allow(non_upper_case_globals)] diff --git a/src/lib.rs b/src/lib.rs index fd5106f..f83caa0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,5 +1,3 @@ -#![feature(old_orphan_check)] - // Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. @@ -45,9 +43,6 @@ //! //! [newt]: https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method -#![feature(associated_types)] -#![feature(macro_rules)] -#![feature(default_type_params)] #![feature(slicing_syntax)] #![cfg_attr(test, deny(warnings))] #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", diff --git a/src/rational.rs b/src/rational.rs index 8210d97..7226152 100644 --- a/src/rational.rs +++ b/src/rational.rs @@ -17,7 +17,6 @@ use std::fmt; use std::ops::{Add, Div, Mul, Neg, Rem, Sub}; use std::str::FromStr; use std::num::{FromPrimitive, FromStrRadix, Float}; -use std::iter::{AdditiveIterator, MultiplicativeIterator}; use bigint::{BigInt, BigUint, Sign}; use {Num, Signed, Zero, One}; @@ -456,25 +455,6 @@ impl } } -impl AdditiveIterator> for T - where A: Clone + Integer + PartialOrd, T: Iterator> -{ - fn sum(self) -> Ratio { - let init: Ratio = Zero::zero(); - self.fold(init, |acc, x| acc + x) - } -} - -impl MultiplicativeIterator> for T - where A: Clone + Integer + PartialOrd, T: Iterator> -{ - fn product(self) -> Ratio { - let init: Ratio = One::one(); - self.fold(init, |acc, x| acc * x) - } -} - - #[cfg(test)] mod test {