about summary refs log tree commit diff
path: root/src/libstd/treemap.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2013-02-25 14:11:21 -0500
committerAlex Crichton <alex@alexcrichton.com>2013-02-28 18:00:34 -0500
commit2df07ddc250b64151401e9b8569a6c7ad5c9b34f (patch)
treeb79fe795609676370a0c19ba809357e45efcc8cc /src/libstd/treemap.rs
parentf2837fa3f53b304b5c9a79d733dfd56da5f32637 (diff)
downloadrust-2df07ddc250b64151401e9b8569a6c7ad5c9b34f.tar.gz
rust-2df07ddc250b64151401e9b8569a6c7ad5c9b34f.zip
Fix implicit leaks of imports throughout libraries
Also touch up use of 'pub' and move some tests around so the tested functions
don't have to be 'pub'
Diffstat (limited to 'src/libstd/treemap.rs')
-rw-r--r--src/libstd/treemap.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/libstd/treemap.rs b/src/libstd/treemap.rs
index cf863217deb..88e4ade4b82 100644
--- a/src/libstd/treemap.rs
+++ b/src/libstd/treemap.rs
@@ -207,8 +207,8 @@ pub struct TreeMapIterator<K, V> {
 /// Advance the iterator to the next node (in order) and return a
 /// tuple with a reference to the key and value. If there are no
 /// more nodes, return `None`.
-fn map_next<K: Ord, V>(iter: &mut TreeMapIterator/&r<K, V>)
-                    -> Option<(&r/K, &r/V)> {
+pub fn map_next<K: Ord, V>(iter: &mut TreeMapIterator/&r<K, V>)
+                        -> Option<(&r/K, &r/V)> {
     while !iter.stack.is_empty() || iter.node.is_some() {
         match *iter.node {
           Some(ref x) => {
@@ -226,7 +226,7 @@ fn map_next<K: Ord, V>(iter: &mut TreeMapIterator/&r<K, V>)
 }
 
 /// Advance the iterator through the map
-fn map_advance<K: Ord, V>(iter: &mut TreeMapIterator/&r<K, V>,
+pub fn map_advance<K: Ord, V>(iter: &mut TreeMapIterator/&r<K, V>,
                           f: fn((&r/K, &r/V)) -> bool) {
     loop {
         match map_next(iter) {
@@ -683,7 +683,11 @@ fn remove<K:Ord,V>(node: &mut Option<~TreeNode<K, V>>, key: &K) -> bool {
 #[cfg(test)]
 mod test_treemap {
     use super::*;
+    use core::cmp::{Ord, Eq};
+    use core::option::{Some, Option, None};
+    use core::rand;
     use core::str;
+    use core::vec;
 
     #[test]
     fn find_empty() {