From 7e6cbf7431671ecdfe60f7ec9fdd5af65248a7a2 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Mon, 25 Jun 2012 13:41:13 -0700 Subject: Remove redundant 'extension' mods from numeric mods --- src/libcore/uint-template.rs | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'src/libcore/uint-template.rs') diff --git a/src/libcore/uint-template.rs b/src/libcore/uint-template.rs index 5d8c9415a77..d341921eb03 100644 --- a/src/libcore/uint-template.rs +++ b/src/libcore/uint-template.rs @@ -1,6 +1,5 @@ import T = inst::T; import cmp::{eq, ord}; -import num::num; export min_value, max_value; export min, max; @@ -12,7 +11,7 @@ export range; export compl; export to_str, to_str_bytes; export from_str, from_str_radix, str, parse_buf; -export ord, eq, extensions; +export num, ord, eq; const min_value: T = 0 as T; const max_value: T = 0 as T - 1 as T; @@ -65,18 +64,16 @@ impl eq of eq for T { } } -mod extensions { - 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; } - } +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; } } #[doc = " -- cgit 1.4.1-3-g733a5