mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-22 09:45:41 +00:00
servo: Update for purity fixes
Source-Repo: https://github.com/servo/servo Source-Revision: b1423f231bb020dc9f219b28c302fe4d49f8f486
This commit is contained in:
parent
2bf0e0c863
commit
4cd85b712f
@ -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> {
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user