Skip to content

Commit 2b83def

Browse files
committed
core: derive Clone for core types
1 parent 28efc23 commit 2b83def

File tree

5 files changed

+6
-5
lines changed

5 files changed

+6
-5
lines changed

src/libcore/core.rc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ pub mod rt;
231231
// can be resolved within libcore.
232232
#[doc(hidden)]
233233
pub mod core {
234+
pub use clone;
234235
pub use cmp;
235236
pub use condition;
236237
pub use option;

src/libcore/either.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use result;
1717
use vec;
1818

1919
/// The either type
20-
#[deriving(Eq)]
20+
#[deriving(Clone, Eq)]
2121
pub enum Either<T, U> {
2222
Left(T),
2323
Right(U)

src/libcore/option.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ use iter::{BaseIter, MutableIter};
5252
#[cfg(test)] use str;
5353

5454
/// The option type
55-
#[deriving(Eq)]
55+
#[deriving(Clone, Eq)]
5656
pub enum Option<T> {
5757
None,
5858
Some(T),

src/libcore/path.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use option::{None, Option, Some};
2020
use str;
2121
use to_str::ToStr;
2222

23-
#[deriving(Eq)]
23+
#[deriving(Clone, Eq)]
2424
pub struct WindowsPath {
2525
host: Option<~str>,
2626
device: Option<~str>,
@@ -32,7 +32,7 @@ pub fn WindowsPath(s: &str) -> WindowsPath {
3232
GenericPath::from_str(s)
3333
}
3434

35-
#[deriving(Eq)]
35+
#[deriving(Clone, Eq)]
3636
pub struct PosixPath {
3737
is_absolute: bool,
3838
components: ~[~str],

src/libcore/result.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use option::{None, Option, Some};
2020
use vec;
2121

2222
/// The result type
23-
#[deriving(Eq)]
23+
#[deriving(Clone, Eq)]
2424
pub enum Result<T, U> {
2525
/// Contains the successful result value
2626
Ok(T),

0 commit comments

Comments
 (0)