Guest User

Untitled

a guest
Oct 20th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. use std::collections::HashMap;
  2. fn main() {
  3. let keywords: HashMap<String, String> =
  4. [(String::from("hello"), String::from("world"))]
  5. .iter().cloned().collect();
  6.  
  7. let s: String = match keywords.get("hello") {
  8. Some(word) => word.to_string(),
  9. None => "None".to_string(),
  10. };
  11. println!("{}", s);
  12. }
Add Comment
Please, Sign In to add comment