From 97452c0ca16238a2de5503aca07db26ff9e8ba63 Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Thu, 2 Aug 2012 15:42:56 -0700 Subject: Remove modes from map API and replace with regions. API is (for now) mostly by value, there are options to use it by reference if you like. Hash and equality functions must be pure and by reference (forward looking to the day when something like send_map becomes the standard map). --- src/libcore/uint-template.rs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/libcore/uint-template.rs') diff --git a/src/libcore/uint-template.rs b/src/libcore/uint-template.rs index 13746df2621..49ea87785ec 100644 --- a/src/libcore/uint-template.rs +++ b/src/libcore/uint-template.rs @@ -19,18 +19,18 @@ const max_value: T = 0 as T - 1 as T; pure fn min(&&x: T, &&y: T) -> T { if x < y { x } else { y } } pure fn max(&&x: T, &&y: T) -> T { if x > y { x } else { y } } -pure fn add(&&x: T, &&y: T) -> T { x + y } -pure fn sub(&&x: T, &&y: T) -> T { x - y } -pure fn mul(&&x: T, &&y: T) -> T { x * y } -pure fn div(&&x: T, &&y: T) -> T { x / y } -pure fn rem(&&x: T, &&y: T) -> T { x % y } - -pure fn lt(&&x: T, &&y: T) -> bool { x < y } -pure fn le(&&x: T, &&y: T) -> bool { x <= y } -pure fn eq(&&x: T, &&y: T) -> bool { x == y } -pure fn ne(&&x: T, &&y: T) -> bool { x != y } -pure fn ge(&&x: T, &&y: T) -> bool { x >= y } -pure fn gt(&&x: T, &&y: T) -> bool { x > y } +pure fn add(x: &T, y: &T) -> T { *x + *y } +pure fn sub(x: &T, y: &T) -> T { *x - *y } +pure fn mul(x: &T, y: &T) -> T { *x * *y } +pure fn div(x: &T, y: &T) -> T { *x / *y } +pure fn rem(x: &T, y: &T) -> T { *x % *y } + +pure fn lt(x: &T, y: &T) -> bool { *x < *y } +pure fn le(x: &T, y: &T) -> bool { *x <= *y } +pure fn eq(x: &T, y: &T) -> bool { *x == *y } +pure fn ne(x: &T, y: &T) -> bool { *x != *y } +pure fn ge(x: &T, y: &T) -> bool { *x >= *y } +pure fn gt(x: &T, y: &T) -> bool { *x > *y } pure fn is_positive(x: T) -> bool { x > 0 as T } pure fn is_negative(x: T) -> bool { x < 0 as T } -- cgit 1.4.1-3-g733a5