Skip to content

Instantly share code, notes, and snippets.

@chills42
Created September 3, 2014 16:41
Show Gist options
  • Save chills42/50158b8e2d8870cdab4d to your computer and use it in GitHub Desktop.
Save chills42/50158b8e2d8870cdab4d to your computer and use it in GitHub Desktop.
expansion error
/*
<std macros>:2:34: 4:6 warning: unused result which must be used, #[warn(unused_must_use)] on by default
<std macros>:2 ($dst:expr, $($arg:tt)*) => ({
<std macros>:3 format_args_method!($dst, write_fmt, $($arg)*)
<std macros>:4 })
<std macros>:1:1: 5:2 note: in expansion of write!
<std macros>:3:9: 3:51 note: expansion site
<std macros>:1:1: 5:2 note: in expansion of writeln!
/src/main.rs:70:9: 70:54 note: expansion site
*/
fn write_file(buckets: &TreeMap<String, uint>, filename: &str) {
let mut file = File::create(&Path::new(filename));
for (bucket, value) in buckets.iter() {
writeln!(&mut file, "{}\t{}", bucket, value);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment