]> git.lizzy.rs Git - rust.git/commitdiff
core: derive Clone for core types
authorAndrew Paseltiner <apaseltiner@gmail.com>
Fri, 22 Mar 2013 19:33:53 +0000 (15:33 -0400)
committerAndrew Paseltiner <apaseltiner@gmail.com>
Sat, 23 Mar 2013 10:54:13 +0000 (06:54 -0400)
src/libcore/core.rc
src/libcore/either.rs
src/libcore/option.rs
src/libcore/path.rs
src/libcore/result.rs

index 080b98933459cf5e02adea0a28205d8b2127aaaa..c97df636386c036fa2625f05c131d599b6c6b136 100644 (file)
@@ -231,6 +231,7 @@ pub mod rt;
 // can be resolved within libcore.
 #[doc(hidden)]
 pub mod core {
+    pub use clone;
     pub use cmp;
     pub use condition;
     pub use option;
index 1cf2c5e1fff2939cd7de8ea3f0a503773e4ef490..2af9e91a30fce5970ec140d8abe210a30090e031 100644 (file)
@@ -17,7 +17,7 @@
 use vec;
 
 /// The either type
-#[deriving(Eq)]
+#[deriving(Clone, Eq)]
 pub enum Either<T, U> {
     Left(T),
     Right(U)
index dd92333b61dbe8051dff25b59137d9c23d0daa7b..bb636636953b36db36ae053a9937cd021022c172 100644 (file)
@@ -52,7 +52,7 @@
 #[cfg(test)] use str;
 
 /// The option type
-#[deriving(Eq)]
+#[deriving(Clone, Eq)]
 pub enum Option<T> {
     None,
     Some(T),
index 5181c08bba0fce2782c6ff016ad1cef5c70c46a0..76aaf14d4ac6ce50a07b347cd10da4d587d339b3 100644 (file)
@@ -20,7 +20,7 @@
 use str;
 use to_str::ToStr;
 
-#[deriving(Eq)]
+#[deriving(Clone, Eq)]
 pub struct WindowsPath {
     host: Option<~str>,
     device: Option<~str>,
@@ -32,7 +32,7 @@ pub fn WindowsPath(s: &str) -> WindowsPath {
     GenericPath::from_str(s)
 }
 
-#[deriving(Eq)]
+#[deriving(Clone, Eq)]
 pub struct PosixPath {
     is_absolute: bool,
     components: ~[~str],
index 5dd2eaf5533d4cd78b732f527a6a6d781a3f2b48..0df9f78a3d6d77494a8ab2fb7b4b1b5f80dbfd9e 100644 (file)
@@ -20,7 +20,7 @@
 use vec;
 
 /// The result type
-#[deriving(Eq)]
+#[deriving(Clone, Eq)]
 pub enum Result<T, U> {
     /// Contains the successful result value
     Ok(T),