about summary refs log tree commit diff
path: root/src/libstd/cell.rs
diff options
context:
space:
mode:
authorDaniel Micay <danielmicay@gmail.com>2013-05-24 01:16:15 -0400
committerDaniel Micay <danielmicay@gmail.com>2013-05-24 01:16:15 -0400
commit0629ef16e8d93e7e461b025e829b350b5daeed6a (patch)
tree4e0547b93542bd93b4f1453728a58450f9957216 /src/libstd/cell.rs
parenta776d65b4d8e5eaad501af2b147cfbe1dbf10d3c (diff)
use deriving for DeepClone
Diffstat (limited to 'src/libstd/cell.rs')
-rw-r--r--src/libstd/cell.rs15
1 files changed, 1 insertions, 14 deletions
diff --git a/src/libstd/cell.rs b/src/libstd/cell.rs
index b707e3bbb9e..d1fa9e697bf 100644
--- a/src/libstd/cell.rs
+++ b/src/libstd/cell.rs
@@ -21,24 +21,11 @@ Similar to a mutable option type, but friendlier.
 */
 
 #[mutable]
-#[deriving(Clone)]
+#[deriving(Clone, DeepClone, Eq)]
 pub struct Cell<T> {
     priv value: Option<T>
 }
 
-impl<T: DeepClone> DeepClone for Cell<T> {
-    fn deep_clone(&self) -> Cell<T> {
-        Cell{value: self.value.deep_clone()}
-    }
-}
-
-impl<T:cmp::Eq> cmp::Eq for Cell<T> {
-    fn eq(&self, other: &Cell<T>) -> bool {
-        (self.value) == (other.value)
-    }
-    fn ne(&self, other: &Cell<T>) -> bool { !self.eq(other) }
-}
-
 /// Creates a new full cell with the given value.
 pub fn Cell<T>(value: T) -> Cell<T> {
     Cell { value: Some(value) }