Skip to content

Import std::num::NumCast explicitly. #57

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 24, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/approxeq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Eps> {
Expand Down Expand Up @@ -44,4 +45,4 @@ impl ApproxEq<f64> for f64 {
fn approx_eq_eps(&self, other: &f64, approx_epsilon: &f64) -> bool {
(*self - *other).abs() < *approx_epsilon
}
}
}
2 changes: 1 addition & 1 deletion src/length.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
///
Expand Down
2 changes: 1 addition & 1 deletion src/point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T> {
Expand Down
2 changes: 1 addition & 1 deletion src/rect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T> {
Expand Down
2 changes: 1 addition & 1 deletion src/scale_factor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand Down
2 changes: 1 addition & 1 deletion src/side_offsets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/size.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T> {
Expand Down