diff options
| author | blake2-ppc <blake2-ppc> | 2013-07-31 21:07:45 +0200 |
|---|---|---|
| committer | blake2-ppc <blake2-ppc> | 2013-08-01 16:54:22 +0200 |
| commit | e5a64f2adddd1ed2ec8e92ec94658b24ece4dbfc (patch) | |
| tree | ea0b6a6b2377a28f127ae2e583f9b795e3cf08a7 /src/libstd | |
| parent | 310e0b6e92e2a5c48a96a0b5c0951d77e402dd75 (diff) | |
| download | rust-e5a64f2adddd1ed2ec8e92ec94658b24ece4dbfc.tar.gz rust-e5a64f2adddd1ed2ec8e92ec94658b24ece4dbfc.zip | |
std: Remove the internal iterator methods from trait Set
.intersection(), .union() etc methods in trait std::container::Set use internal iters. Remove these methods from the trait. I reported issue #8154 for the reinstatement of iterator-based set algebra methods to the Set trait. For bitv and treemap, that lack Iterator implementations of set operations, preserve them as methods directly on the types themselves. For HashSet, these methods are replaced by the present .union_iter() etc.
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/container.rs | 12 | ||||
| -rw-r--r-- | src/libstd/hashmap.rs | 22 |
2 files changed, 1 insertions, 33 deletions
diff --git a/src/libstd/container.rs b/src/libstd/container.rs index d855beea50b..10f3fc6586f 100644 --- a/src/libstd/container.rs +++ b/src/libstd/container.rs @@ -87,17 +87,7 @@ pub trait Set<T>: Container { /// Return true if the set is a superset of another fn is_superset(&self, other: &Self) -> bool; - /// Visit the values representing the difference - fn difference(&self, other: &Self, f: &fn(&T) -> bool) -> bool; - - /// Visit the values representing the symmetric difference - fn symmetric_difference(&self, other: &Self, f: &fn(&T) -> bool) -> bool; - - /// Visit the values representing the intersection - fn intersection(&self, other: &Self, f: &fn(&T) -> bool) -> bool; - - /// Visit the values representing the union - fn union(&self, other: &Self, f: &fn(&T) -> bool) -> bool; + // FIXME #8154: Add difference, sym. difference, intersection and union iterators } /// This trait represents actions which can be performed on sets to mutate diff --git a/src/libstd/hashmap.rs b/src/libstd/hashmap.rs index 8c06f23b8c1..ca61f3e5ad8 100644 --- a/src/libstd/hashmap.rs +++ b/src/libstd/hashmap.rs @@ -672,28 +672,6 @@ impl<T:Hash + Eq> Set<T> for HashSet<T> { fn is_superset(&self, other: &HashSet<T>) -> bool { other.is_subset(self) } - - /// Visit the values representing the difference - fn difference(&self, other: &HashSet<T>, f: &fn(&T) -> bool) -> bool { - self.difference_iter(other).advance(f) - } - - /// Visit the values representing the symmetric difference - fn symmetric_difference(&self, - other: &HashSet<T>, - f: &fn(&T) -> bool) -> bool { - self.symmetric_difference_iter(other).advance(f) - } - - /// Visit the values representing the intersection - fn intersection(&self, other: &HashSet<T>, f: &fn(&T) -> bool) -> bool { - self.intersection_iter(other).advance(f) - } - - /// Visit the values representing the union - fn union(&self, other: &HashSet<T>, f: &fn(&T) -> bool) -> bool { - self.union_iter(other).advance(f) - } } impl<T:Hash + Eq> MutableSet<T> for HashSet<T> { |
