auto merge of #13891 : hjr3/rust/serialize-vec, r=pcwalton
Now that ~[T] is obsolete, we need to allow to_json() to work for vectors.
This commit is contained in:
commit
d1ca0b1371
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user