From 923a8f39caa4504b7825ff9f8ba0b875345ebf83 Mon Sep 17 00:00:00 2001 From: "Herman J. Radtke III" Date: Fri, 2 May 2014 00:02:15 -0700 Subject: [PATCH] Implement ToJson for Vec Now that ~[T] is obsolete, we need to allow to_json() to work for vectors. --- src/libserialize/json.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libserialize/json.rs b/src/libserialize/json.rs index 25ee03a44c2..6e7fab21442 100644 --- a/src/libserialize/json.rs +++ b/src/libserialize/json.rs @@ -2233,6 +2233,10 @@ impl ToJson for ~[A] { fn to_json(&self) -> Json { List(self.iter().map(|elt| elt.to_json()).collect()) } } +impl ToJson for Vec { + fn to_json(&self) -> Json { List(self.iter().map(|elt| elt.to_json()).collect()) } +} + impl ToJson for TreeMap<~str, A> { fn to_json(&self) -> Json { let mut d = TreeMap::new();