File tree Expand file tree Collapse file tree 2 files changed +2
-24
lines changed
Expand file tree Collapse file tree 2 files changed +2
-24
lines changed Original file line number Diff line number Diff line change @@ -21,24 +21,11 @@ Similar to a mutable option type, but friendlier.
2121*/
2222
2323#[ mutable]
24- #[ deriving( Clone ) ]
24+ #[ deriving( Clone , DeepClone , Eq ) ]
2525pub struct Cell < T > {
2626 priv value : Option < T >
2727}
2828
29- impl < T : DeepClone > DeepClone for Cell < T > {
30- fn deep_clone ( & self ) -> Cell < T > {
31- Cell { value : self . value . deep_clone ( ) }
32- }
33- }
34-
35- impl < T : cmp:: Eq > cmp:: Eq for Cell < T > {
36- fn eq ( & self , other : & Cell < T > ) -> bool {
37- ( self . value ) == ( other. value )
38- }
39- fn ne ( & self , other : & Cell < T > ) -> bool { !self . eq ( other) }
40- }
41-
4229/// Creates a new full cell with the given value.
4330pub fn Cell < T > ( value : T ) -> Cell < T > {
4431 Cell { value : Some ( value) }
Original file line number Diff line number Diff line change @@ -54,21 +54,12 @@ use clone::DeepClone;
5454#[ cfg( test) ] use str;
5555
5656/// The option type
57- #[ deriving( Clone , Eq ) ]
57+ #[ deriving( Clone , DeepClone , Eq ) ]
5858pub enum Option < T > {
5959 None ,
6060 Some ( T ) ,
6161}
6262
63- impl < T : DeepClone > DeepClone for Option < T > {
64- fn deep_clone ( & self ) -> Option < T > {
65- match * self {
66- Some ( ref x) => Some ( x. deep_clone ( ) ) ,
67- None => None
68- }
69- }
70- }
71-
7263impl < T : Ord > Ord for Option < T > {
7364 fn lt ( & self , other : & Option < T > ) -> bool {
7465 match ( self , other) {
You can’t perform that action at this time.
0 commit comments