Switch to using num_traits crate from num

Fixes #336
This commit is contained in:
Brendan Zabarauskas 2016-04-23 14:03:35 +10:00
parent 73b8a6b675
commit 86c13ca14f
12 changed files with 19 additions and 19 deletions

View file

@ -30,7 +30,7 @@ name = "cgmath"
unstable = []
[dependencies]
num = "0.1"
num-traits = "0.1"
rand = "0.3"
rustc-serialize = "0.3"

View file

@ -21,8 +21,8 @@ use std::ops::*;
use rand::{Rand, Rng};
use rand::distributions::range::SampleRange;
use rust_num::{Float, Zero};
use rust_num::traits::cast;
use num_traits::{Float, Zero};
use num_traits::cast;
use structure::Angle;

View file

@ -13,8 +13,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use rust_num::{Float, NumCast};
use rust_num::traits::cast;
use num_traits::{Float, NumCast};
use num_traits::cast;
pub trait ApproxEq: Sized {
type Epsilon: NumCast + Float;

View file

@ -49,7 +49,7 @@
//! use cgmath::prelude::*;
//! ```
extern crate num as rust_num;
extern crate num_traits;
extern crate rustc_serialize;
extern crate rand;
@ -70,7 +70,7 @@ pub use transform::*;
pub use projection::*;
pub use rust_num::{One, Zero, one, zero};
pub use num_traits::{One, Zero};
// Modules

View file

@ -14,8 +14,8 @@
// limitations under the License.
use rand::{Rand, Rng};
use rust_num::{Zero, One};
use rust_num::traits::cast;
use num_traits::{Zero, One};
use num_traits::cast;
use std::fmt;
use std::mem;
use std::ops::*;

View file

@ -19,7 +19,7 @@ use std::cmp;
use std::fmt;
use std::ops::*;
use rust_num::{Float, Num, NumCast};
use num_traits::{Float, Num, NumCast};
/// A trait providing a [partial ordering](http://mathworld.wolfram.com/PartialOrder.html).
pub trait PartialOrd {

View file

@ -21,7 +21,7 @@ use std::fmt;
use std::mem;
use std::ops::*;
use rust_num::{One, Zero};
use num_traits::{One, Zero};
use structure::*;

View file

@ -13,8 +13,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use rust_num::{Zero, One};
use rust_num::traits::cast;
use num_traits::{Zero, One};
use num_traits::cast;
use structure::Angle;

View file

@ -17,8 +17,8 @@ use std::mem;
use std::ops::*;
use rand::{Rand, Rng};
use rust_num::{Float, One, Zero};
use rust_num::traits::cast;
use num_traits::{Float, One, Zero};
use num_traits::cast;
use structure::*;

View file

@ -15,7 +15,7 @@
//! Generic algebraic structures
use rust_num::{cast, Float, One, Zero};
use num_traits::{cast, Float, One, Zero};
use std::cmp;
use std::ops::*;
@ -198,7 +198,7 @@ pub trait InnerSpace: VectorSpace + Sized where
/// The distance from the tail to the tip of the vector.
#[inline]
fn magnitude(self) -> Self::Scalar {
use rust_num::Float;
use num_traits::Float;
// FIXME: Not sure why we can't use method syntax for `sqrt` here...
Float::sqrt(self.magnitude2())

View file

@ -15,7 +15,7 @@
use std::fmt;
use rust_num::{Zero, One};
use num_traits::{Zero, One};
use structure::*;

View file

@ -14,7 +14,7 @@
// limitations under the License.
use rand::{Rand, Rng};
use rust_num::{NumCast, Zero, One};
use num_traits::{NumCast, Zero, One};
use std::fmt;
use std::mem;
use std::ops::*;