Skip to content

Commit caf316a

Browse files
committed
auto merge of #11510 : wycats/rust/clone-treeset, r=huonw
2 parents b93a4da + 8f6ffde commit caf316a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Diff for: src/libextra/treemap.rs

+11
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,7 @@ impl<'a, T> Iterator<&'a T> for TreeSetRevIterator<'a, T> {
549549
/// A implementation of the `Set` trait on top of the `TreeMap` container. The
550550
/// only requirement is that the type of the elements contained ascribes to the
551551
/// `TotalOrd` trait.
552+
#[deriving(Clone)]
552553
pub struct TreeSet<T> {
553554
priv map: TreeMap<T, ()>
554555
}
@@ -1588,6 +1589,16 @@ mod test_set {
15881589
}
15891590
}
15901591

1592+
#[test]
1593+
fn test_clone_eq() {
1594+
let mut m = TreeSet::new();
1595+
1596+
m.insert(1);
1597+
m.insert(2);
1598+
1599+
assert!(m.clone() == m);
1600+
}
1601+
15911602
fn check(a: &[int],
15921603
b: &[int],
15931604
expected: &[int],

0 commit comments

Comments
 (0)