Created
August 29, 2014 14:47
-
-
Save JEG2/460b5f98e9b7f14561d2 to your computer and use it in GitHub Desktop.
Exploring capturing strings in a Rust task.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::collections::HashMap; | |
fn main() { | |
let mut services = HashMap::new(); | |
services.insert("S1", vec!["A", "C"]); | |
for (name, stops) in services.iter() { | |
spawn( proc() { | |
println!("{}", name); | |
} ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment