Implement ToJson for Vec<T>
Now that ~[T] is obsolete, we need to allow to_json() to work for vectors.
This commit is contained in:
parent
adcbf53955
commit
923a8f39ca
1 changed files with 4 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue