Skip to content

Instantly share code, notes, and snippets.

Created July 6, 2016 20:35
Show Gist options
  • Save anonymous/d082c5d632ab0249fe1fa917c76f7178 to your computer and use it in GitHub Desktop.
Save anonymous/d082c5d632ab0249fe1fa917c76f7178 to your computer and use it in GitHub Desktop.
Shared via Rust Playground
use std::collections::HashMap;
fn main() {
let port = "1025";
// Works if I reverse these two lines
let mut data = HashMap::new();
let port = port.to_string();
data.insert("port", &port);
println!("{:?}", data);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment