]> git.lizzy.rs Git - rust.git/commitdiff
libserialize: use unboxed closures
authorJorge Aparicio <japaricious@gmail.com>
Sun, 7 Dec 2014 16:59:59 +0000 (11:59 -0500)
committerJorge Aparicio <japaricious@gmail.com>
Sat, 13 Dec 2014 22:03:47 +0000 (17:03 -0500)
src/libserialize/json.rs

index 37bd11ba59f45b6928ef17d72ee7760de956a6c7..d34828ccee328e58822e2a6262963d9ce4393b06 100644 (file)
@@ -2680,7 +2680,7 @@ fn test_write_object() {
                    from_str(a.to_pretty_str().as_slice()).unwrap());
     }
 
-    fn with_str_writer(f: |&mut io::Writer|) -> string::String {
+    fn with_str_writer<F>(f: F) -> string::String where F: FnOnce(&mut io::Writer){
         use std::str;
 
         let mut m = Vec::new();