Skip to content

Instantly share code, notes, and snippets.

@bvssvni
Created April 2, 2014 21:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bvssvni/9943662 to your computer and use it in GitHub Desktop.
Save bvssvni/9943662 to your computer and use it in GitHub Desktop.
fn insert_text(text: &mut HashMap<&'static str, &'static str>) {
let text: Vec<&'static str> = vec!(include!("text.rs"));
for chunk in text.as_slice().chunks(2) {
let id: &'static str = *chunk.get(0).unwrap();
let txt: &'static str = *chunk.get(1).unwrap();
text.insert(id, txt);
}
}
src/main.rs:20:21: 20:23 error: mismatched types: expected `uint` but found `&'static str` (expected uint but found &'static str)
src/main.rs:20 text.insert(id, txt);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment