Created
December 4, 2013 13:23
-
-
Save Blei/7787352 to your computer and use it in GitHub Desktop.
wtf, rust?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Config.rs:34 | |
fn save_PrettyJSON<'a, T: Encodable<json::PrettyEncoder<'a>>>(p: &Path, toEncode: ~[T]) { | |
match File::create(p) { | |
Some(f) => { | |
let f2 = @mut f as @mut io::Writer; | |
let a = &mut json::PrettyEncoder::init(f2); | |
toEncode.encode(a); | |
}, None => fail!("failed to save json") | |
}; | |
} |
Author
Blei
commented
Dec 4, 2013
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment