diff --git a/src/libstd/treemap.rs b/src/libstd/treemap.rs index 0bb8738773c9..fa9f8dc805e4 100644 --- a/src/libstd/treemap.rs +++ b/src/libstd/treemap.rs @@ -120,8 +120,6 @@ impl TreeMap { /// Create an empty TreeMap static pure fn new() -> TreeMap { TreeMap{root: None, length: 0} } - /// Return true if the map contains some elements - pure fn is_not_empty(&self) -> bool { self.root.is_some() } /// Visit all key-value pairs in reverse order pure fn each_reverse(&self, f: fn(&K, &V) -> bool) { @@ -176,7 +174,7 @@ impl TreeMapIterator { /// tuple with a reference to the key and value. If there are no /// more nodes, return `None`. fn next(&mut self) -> Option<(&self/K, &self/V)> { - while self.stack.is_not_empty() || self.node.is_some() { + while !self.stack.is_empty() || self.node.is_some() { match *self.node { Some(ref x) => { self.stack.push(x); @@ -240,9 +238,6 @@ impl TreeSet { /// Create an empty TreeSet static pure fn new() -> TreeSet { TreeSet{map: TreeMap::new()} } - /// Return true if the set contains some elements - pure fn is_not_empty(&self) -> bool { self.map.is_not_empty() } - /// Visit all values in reverse order pure fn each_reverse(&self, f: fn(&T) -> bool) { self.map.each_key_reverse(f) @@ -675,7 +670,6 @@ mod test_treemap { fn check_equal(ctrl: &[(K, V)], map: &TreeMap) { assert ctrl.is_empty() == map.is_empty(); - assert ctrl.is_not_empty() == map.is_not_empty(); for ctrl.each |x| { let &(k, v) = x; assert map.find(&k).unwrap() == &v