servo: Update for purity fixes

Source-Repo: https://github.com/servo/servo
Source-Revision: b1423f231bb020dc9f219b28c302fe4d49f8f486
This commit is contained in:
Patrick Walton 2012-07-26 18:02:36 -07:00
parent 2bf0e0c863
commit 4cd85b712f
2 changed files with 9 additions and 9 deletions

View File

@ -6,15 +6,15 @@ import num::num;
enum au = int;
impl au of num for au {
fn add(&&other: au) -> au { au(*self + *other) }
fn sub(&&other: au) -> au { au(*self - *other) }
fn mul(&&other: au) -> au { au(*self * *other) }
fn div(&&other: au) -> au { au(*self / *other) }
fn modulo(&&other: au) -> au { au(*self % *other) }
fn neg() -> au { au(-*self) }
pure fn add(&&other: au) -> au { au(*self + *other) }
pure fn sub(&&other: au) -> au { au(*self - *other) }
pure fn mul(&&other: au) -> au { au(*self * *other) }
pure fn div(&&other: au) -> au { au(*self / *other) }
pure fn modulo(&&other: au) -> au { au(*self % *other) }
pure fn neg() -> au { au(-*self) }
fn to_int() -> int { *self }
fn from_int(n: int) -> au { au(n) }
pure fn to_int() -> int { *self }
pure fn from_int(n: int) -> au { au(n) }
}
fn box<A:copy num>(x: A, y: A, w: A, h: A) -> Rect<A> {

View File

@ -12,7 +12,7 @@ import cmp::eq;
enum Color = {red : u8, green : u8, blue : u8, alpha : float};
impl Color of eq for Color {
fn eq(&&other: Color) -> bool {
pure fn eq(&&other: Color) -> bool {
ret self.red == other.red && self.green == other.green && self.blue == other.blue &&
self.alpha == other.alpha;
}