diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2012-07-26 14:42:44 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2012-07-26 14:43:44 -0700 |
| commit | 1dd8acd56acc189db2c0bb3266536d35646380b4 (patch) | |
| tree | 0db1a397edd40c8fe75ffcfb7673c8203be61812 /src/libcore/uint-template.rs | |
| parent | d19b915bc40d36cdf9866bfd3cf160ddabc7cc9d (diff) | |
core: Mark a bunch of numeric functions as pure
Diffstat (limited to 'src/libcore/uint-template.rs')
| -rw-r--r-- | src/libcore/uint-template.rs | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/libcore/uint-template.rs b/src/libcore/uint-template.rs index 75e17cd6a9b..9561ed4e65f 100644 --- a/src/libcore/uint-template.rs +++ b/src/libcore/uint-template.rs @@ -53,27 +53,27 @@ pure fn compl(i: T) -> T { } impl ord of ord for T { - fn lt(&&other: T) -> bool { + pure fn lt(&&other: T) -> bool { ret self < other; } } impl eq of eq for T { - fn eq(&&other: T) -> bool { + pure fn eq(&&other: T) -> bool { ret self == other; } } impl num of num::num for T { - fn add(&&other: T) -> T { ret self + other; } - fn sub(&&other: T) -> T { ret self - other; } - fn mul(&&other: T) -> T { ret self * other; } - fn div(&&other: T) -> T { ret self / other; } - fn modulo(&&other: T) -> T { ret self % other; } - fn neg() -> T { ret -self; } - - fn to_int() -> int { ret self as int; } - fn from_int(n: int) -> T { ret n as T; } + pure fn add(&&other: T) -> T { ret self + other; } + pure fn sub(&&other: T) -> T { ret self - other; } + pure fn mul(&&other: T) -> T { ret self * other; } + pure fn div(&&other: T) -> T { ret self / other; } + pure fn modulo(&&other: T) -> T { ret self % other; } + pure fn neg() -> T { ret -self; } + + pure fn to_int() -> int { ret self as int; } + pure fn from_int(n: int) -> T { ret n as T; } } /** |
