Skip to content

Commit

Permalink
Add Clone to TreeSet
Browse files Browse the repository at this point in the history
  • Loading branch information
wycats committed Jan 13, 2014
1 parent b93a4da commit 8f6ffde
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/libextra/treemap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,7 @@ impl<'a, T> Iterator<&'a T> for TreeSetRevIterator<'a, T> {
/// A implementation of the `Set` trait on top of the `TreeMap` container. The
/// only requirement is that the type of the elements contained ascribes to the
/// `TotalOrd` trait.
#[deriving(Clone)]
pub struct TreeSet<T> {
priv map: TreeMap<T, ()>
}
Expand Down Expand Up @@ -1588,6 +1589,16 @@ mod test_set {
}
}

#[test]
fn test_clone_eq() {
let mut m = TreeSet::new();

m.insert(1);
m.insert(2);

assert!(m.clone() == m);
}

fn check(a: &[int],
b: &[int],
expected: &[int],
Expand Down

5 comments on commit 8f6ffde

@bors
Copy link
Contributor

@bors bors commented on 8f6ffde Jan 13, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from huonw
at wycats@8f6ffde

@bors
Copy link
Contributor

@bors bors commented on 8f6ffde Jan 13, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging wycats/rust/clone-treeset = 8f6ffde into auto

@bors
Copy link
Contributor

@bors bors commented on 8f6ffde Jan 13, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wycats/rust/clone-treeset = 8f6ffde merged ok, testing candidate = caf316a

@bors
Copy link
Contributor

@bors bors commented on 8f6ffde Jan 13, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on 8f6ffde Jan 13, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = caf316a

Please sign in to comment.