diff --git a/src/approxeq.rs b/src/approxeq.rs index ccd173a0..591ad424 100644 --- a/src/approxeq.rs +++ b/src/approxeq.rs @@ -7,6 +7,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::num::Float; /// Trait for testing approximate equality pub trait ApproxEq { @@ -44,4 +45,4 @@ impl ApproxEq for f64 { fn approx_eq_eps(&self, other: &f64, approx_epsilon: &f64) -> bool { (*self - *other).abs() < *approx_epsilon } -} \ No newline at end of file +} diff --git a/src/length.rs b/src/length.rs index 1185fb08..19927e1a 100644 --- a/src/length.rs +++ b/src/length.rs @@ -10,7 +10,7 @@ use scale_factor::ScaleFactor; -use std::num::{cast, Zero}; +use std::num::{NumCast, cast, Zero}; /// A one-dimensional distance, with value represented by `T` and unit of measurement `Unit`. /// diff --git a/src/point.rs b/src/point.rs index 67730a60..3574dc7c 100644 --- a/src/point.rs +++ b/src/point.rs @@ -11,7 +11,7 @@ use length::Length; use size::Size2D; use std::fmt; -use std::num::Zero; +use std::num::{NumCast, Zero}; #[deriving(Clone, Decodable, Encodable, Eq, Hash, PartialEq)] pub struct Point2D { diff --git a/src/rect.rs b/src/rect.rs index edc6c5bd..348f86e0 100644 --- a/src/rect.rs +++ b/src/rect.rs @@ -13,7 +13,7 @@ use point::Point2D; use size::Size2D; use std::cmp::{PartialEq, PartialOrd}; use std::fmt; -use std::num::Zero; +use std::num::{NumCast, Zero}; #[deriving(Clone, Decodable, Encodable, PartialEq)] pub struct Rect { diff --git a/src/scale_factor.rs b/src/scale_factor.rs index 818c24fd..a010ccfe 100644 --- a/src/scale_factor.rs +++ b/src/scale_factor.rs @@ -8,7 +8,7 @@ // except according to those terms. //! A type-checked scaling factor between units. -use std::num::{cast, One}; +use std::num::{NumCast, cast, One}; /// A scaling factor between two different units of measurement. /// diff --git a/src/side_offsets.rs b/src/side_offsets.rs index ee0cd4d6..bf84dffd 100644 --- a/src/side_offsets.rs +++ b/src/side_offsets.rs @@ -10,7 +10,7 @@ //! A group of side offsets, which correspond to top/left/bottom/right for borders, padding, //! and margins in CSS. -use std::num::Zero; +use std::num::{Num, NumCast, Zero}; /// A group of side offsets, which correspond to top/left/bottom/right for borders, padding, /// and margins in CSS. diff --git a/src/size.rs b/src/size.rs index ff9fb3f5..0025539f 100644 --- a/src/size.rs +++ b/src/size.rs @@ -11,7 +11,7 @@ use length::Length; use std::cmp::PartialEq; use std::fmt; -use std::num::Zero; +use std::num::{NumCast, Zero}; #[deriving(Clone, Decodable, Encodable, PartialEq)] pub struct Size2D {