Remove usage of the deprecated std::num::Zero trait.

This commit is contained in:
Simon Sapin 2014-12-18 11:16:47 +00:00
parent 32c721e640
commit 084a63df45
10 changed files with 42 additions and 51 deletions

View file

@ -6,11 +6,12 @@ use geom::length::Length;
use geom::point::Point2D;
use geom::rect::Rect;
use geom::size::Size2D;
use geom::num::Zero;
use serialize::{Encodable, Encoder};
use std::default::Default;
use std::i32;
use std::num::{Float, NumCast, Zero};
use std::num::{Float, NumCast};
use std::fmt;
// Units for use with geom::length and geom::scale_factor.
@ -64,7 +65,7 @@ pub enum PagePx {}
// See https://bugzilla.mozilla.org/show_bug.cgi?id=177805 for more info.
//
// FIXME: Implement Au using Length and ScaleFactor instead of a custom type.
#[deriving(Clone, Hash, PartialEq, PartialOrd, Eq, Ord, Zero)]
#[deriving(Clone, Hash, PartialEq, PartialOrd, Eq, Ord)]
pub struct Au(pub i32);
impl Default for Au {
@ -74,6 +75,13 @@ impl Default for Au {
}
}
impl Zero for Au {
#[inline]
fn zero() -> Au {
Au(0)
}
}
pub static ZERO_POINT: Point2D<Au> = Point2D {
x: Au(0),
y: Au(0),