about summary refs log tree commit diff
path: root/src/libcore/uint-template.rs
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2012-08-02 15:42:56 -0700
committerNiko Matsakis <niko@alum.mit.edu>2012-08-02 15:53:28 -0700
commit97452c0ca16238a2de5503aca07db26ff9e8ba63 (patch)
tree47ef430d1671ab297bc192009aa74a23723a42fc /src/libcore/uint-template.rs
parent476ce459bd3b687658e566c75d0fb73281450d67 (diff)
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).
Diffstat (limited to 'src/libcore/uint-template.rs')
-rw-r--r--src/libcore/uint-template.rs24
1 files changed, 12 insertions, 12 deletions
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 }