summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorJesse Jones <jesse9jones@gmail.com>2012-11-17 09:56:05 -0800
committerBrian Anderson <banderson@mozilla.com>2012-11-18 13:25:25 -0800
commitc5ab47e7ba8881fb76e2266e105d373b59ed09db (patch)
tree898f490ae7cb53277d0a644c973726ec67412c59 /src/libcore
parent2c0dab02ad64e581ede4344401dca0db67430897 (diff)
downloadrust-c5ab47e7ba8881fb76e2266e105d373b59ed09db.tar.gz
rust-c5ab47e7ba8881fb76e2266e105d373b59ed09db.zip
Made Result.get, get_ref, is_ok, is_err, and iter methods pure.
Note that the function versions were already pure.
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/result.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libcore/result.rs b/src/libcore/result.rs
index 2df2974d0ba..da7db607c85 100644
--- a/src/libcore/result.rs
+++ b/src/libcore/result.rs
@@ -204,13 +204,13 @@ pub fn map_err<T: Copy, E, F: Copy>(res: &Result<T, E>, op: fn((&E)) -> F)
 }
 
 impl<T, E> Result<T, E> {
-    fn get_ref(&self) -> &self/T { get_ref(self) }
+    pure fn get_ref(&self) -> &self/T { get_ref(self) }
 
-    fn is_ok() -> bool { is_ok(&self) }
+    pure fn is_ok() -> bool { is_ok(&self) }
 
-    fn is_err() -> bool { is_err(&self) }
+    pure fn is_err() -> bool { is_err(&self) }
 
-    fn iter(f: fn((&T))) {
+    pure fn iter(f: fn((&T))) {
         match self {
           Ok(ref t) => f(t),
           Err(_) => ()
@@ -226,7 +226,7 @@ impl<T, E> Result<T, E> {
 }
 
 impl<T: Copy, E> Result<T, E> {
-    fn get() -> T { get(&self) }
+    pure fn get() -> T { get(&self) }
 
     fn map_err<F:Copy>(op: fn((&E)) -> F) -> Result<T,F> {
         match self {
@@ -237,7 +237,7 @@ impl<T: Copy, E> Result<T, E> {
 }
 
 impl<T, E: Copy> Result<T, E> {
-    fn get_err() -> E { get_err(&self) }
+    pure fn get_err() -> E { get_err(&self) }
 
     fn map<U:Copy>(op: fn((&T)) -> U) -> Result<U,E> {
         match self {