Skip to content
Permalink
Browse files
😄
  • Loading branch information
steveklabnik committed Oct 27, 2014
1 parent adb3342 commit 9a85a958deb0e3521075d219c119b8dcf7ee824d
Showing 1 changed file with 1 addition and 1 deletion.
@@ -34,7 +34,7 @@ struct Todo {
// Specify encoding method manually
impl ToJson for Vec<Todo> {
fn to_json(&self) -> json::Json {
let todos = self.iter().map({|todo| json::encode(todo) }).collect::<Vec<_>>();
let todos = self.iter().map(json::encode).collect::<Vec<_>>();

let mut d = TreeMap::new();
d.insert("todos".to_string(), todos.to_json());

1 comment on commit 9a85a95

@pepe
Copy link
Contributor

@pepe pepe commented on 9a85a95 Oct 30, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ha ha great!

Please sign in to comment.