about summary refs log tree commit diff
path: root/src/libcore/cell.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2013-05-06 00:42:54 -0400
committerAlex Crichton <alex@alexcrichton.com>2013-05-10 22:51:06 -0400
commit998fececd6516fa07d0cd0a0c4607ddef0bc40f0 (patch)
tree9597e6c2f0592136086f722338b95196f71104ec /src/libcore/cell.rs
parent7d22437ecdc5b52f8517ffde6207347739b26553 (diff)
downloadrust-998fececd6516fa07d0cd0a0c4607ddef0bc40f0.tar.gz
rust-998fececd6516fa07d0cd0a0c4607ddef0bc40f0.zip
Stop using the '<->' operator
Diffstat (limited to 'src/libcore/cell.rs')
-rw-r--r--src/libcore/cell.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/libcore/cell.rs b/src/libcore/cell.rs
index c7f9e377571..18e75fb1aa9 100644
--- a/src/libcore/cell.rs
+++ b/src/libcore/cell.rs
@@ -12,6 +12,7 @@
 
 use cast::transmute_mut;
 use prelude::*;
+use util::replace;
 
 /*
 A dynamic, mutable location.
@@ -48,9 +49,7 @@ pub impl<T> Cell<T> {
             fail!(~"attempt to take an empty cell");
         }
 
-        let mut value = None;
-        value <-> self.value;
-        value.unwrap()
+        replace(&mut self.value, None).unwrap()
     }
 
     /// Returns the value, failing if the cell is full.