mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Update for purity fixes
This commit is contained in:
parent
71c8b83d2a
commit
b1423f231b
2 changed files with 9 additions and 9 deletions
|
@ -6,15 +6,15 @@ import num::num;
|
||||||
enum au = int;
|
enum au = int;
|
||||||
|
|
||||||
impl au of num for au {
|
impl au of num for au {
|
||||||
fn add(&&other: au) -> au { au(*self + *other) }
|
pure fn add(&&other: au) -> au { au(*self + *other) }
|
||||||
fn sub(&&other: au) -> au { au(*self - *other) }
|
pure fn sub(&&other: au) -> au { au(*self - *other) }
|
||||||
fn mul(&&other: au) -> au { au(*self * *other) }
|
pure fn mul(&&other: au) -> au { au(*self * *other) }
|
||||||
fn div(&&other: au) -> au { au(*self / *other) }
|
pure fn div(&&other: au) -> au { au(*self / *other) }
|
||||||
fn modulo(&&other: au) -> au { au(*self % *other) }
|
pure fn modulo(&&other: au) -> au { au(*self % *other) }
|
||||||
fn neg() -> au { au(-*self) }
|
pure fn neg() -> au { au(-*self) }
|
||||||
|
|
||||||
fn to_int() -> int { *self }
|
pure fn to_int() -> int { *self }
|
||||||
fn from_int(n: int) -> au { au(n) }
|
pure fn from_int(n: int) -> au { au(n) }
|
||||||
}
|
}
|
||||||
|
|
||||||
fn box<A:copy num>(x: A, y: A, w: A, h: A) -> Rect<A> {
|
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};
|
enum Color = {red : u8, green : u8, blue : u8, alpha : float};
|
||||||
|
|
||||||
impl Color of eq for Color {
|
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 &&
|
ret self.red == other.red && self.green == other.green && self.blue == other.blue &&
|
||||||
self.alpha == other.alpha;
|
self.alpha == other.alpha;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue