Skip to content

Commit

Permalink
auto merge of #13891 : hjr3/rust/serialize-vec, r=pcwalton
Browse files Browse the repository at this point in the history
Now that ~[T] is obsolete, we need to allow to_json() to work for
vectors.
  • Loading branch information
bors committed May 3, 2014
2 parents 3a321b0 + 923a8f3 commit d1ca0b1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/libserialize/json.rs
Expand Up @@ -2233,6 +2233,10 @@ impl<A:ToJson> ToJson for ~[A] {
fn to_json(&self) -> Json { List(self.iter().map(|elt| elt.to_json()).collect()) }
}

impl<A:ToJson> ToJson for Vec<A> {
fn to_json(&self) -> Json { List(self.iter().map(|elt| elt.to_json()).collect()) }
}

impl<A:ToJson> ToJson for TreeMap<~str, A> {
fn to_json(&self) -> Json {
let mut d = TreeMap::new();
Expand Down

0 comments on commit d1ca0b1

Please sign in to comment.