Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use std::collections::HashMap;
- fn main() {
- let keywords: HashMap<String, String> =
- [(String::from("hello"), String::from("world"))]
- .iter().cloned().collect();
- let s: String = match keywords.get("hello") {
- Some(word) => word.to_string(),
- None => "None".to_string(),
- };
- println!("{}", s);
- }
Add Comment
Please, Sign In to add comment