about summary refs log tree commit diff
path: root/src/libstd/treemap.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstd/treemap.rs')
-rw-r--r--src/libstd/treemap.rs14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/libstd/treemap.rs b/src/libstd/treemap.rs
index e79025a7955..da83c7b789b 100644
--- a/src/libstd/treemap.rs
+++ b/src/libstd/treemap.rs
@@ -556,24 +556,18 @@ impl <K: Ord, V> TreeNode<K, V> {
 
 pure fn each<K: Ord, V>(node: &r/Option<~TreeNode<K, V>>,
                         f: fn(&(&r/K, &r/V)) -> bool) {
-    match *node {
-      Some(ref x) => {
+    do node.map |x| {
         each(&x.left, f);
         if f(&(&x.key, &x.value)) { each(&x.right, f) }
-      }
-      None => ()
-    }
+    };
 }
 
 pure fn each_reverse<K: Ord, V>(node: &r/Option<~TreeNode<K, V>>,
                                 f: fn(&(&r/K, &r/V)) -> bool) {
-    match *node {
-      Some(ref x) => {
+    do node.map |x| {
         each_reverse(&x.right, f);
         if f(&(&x.key, &x.value)) { each_reverse(&x.left, f) }
-      }
-      None => ()
-    }
+    };
 }
 
 // Remove left horizontal link by rotating right