]> git.lizzy.rs Git - rust.git/blobdiff - src/test/run-pass/hashmap-memory.rs
port over the tests to use the new API
[rust.git] / src / test / run-pass / hashmap-memory.rs
index 8670a53ac335e11befacc9bd6a9b7528fe723a63..5c6e14e93a852c02d901c5ca6efa8e5a088676d2 100644 (file)
@@ -33,12 +33,12 @@ mod map_reduce {
     tag ctrl_proto { find_reducer([u8], chan<int>); mapper_done; }
 
     fn start_mappers(ctrl: chan<ctrl_proto>, inputs: [str]) {
-        for i: str in inputs { task::spawn((ctrl, i), map_task); }
+        for i: str in inputs {
+            task::spawn {|| map_task(ctrl, i); };
+        }
     }
 
-    fn map_task(&&args: (chan<ctrl_proto>, str)) {
-        let (ctrl, input) = args;
-
+    fn map_task(ctrl: chan<ctrl_proto>, input: str) {
         let intermediates = map::new_str_hash();
 
         fn emit(im: map::hashmap<str, int>, ctrl: chan<ctrl_proto>, key: str,