1
Fork 0

rollup merge of #18707 : japaric/moar-dst

This commit is contained in:
Alex Crichton 2014-11-06 13:32:58 -08:00
commit 953302f85f
7 changed files with 77 additions and 18 deletions

View file

@ -2303,7 +2303,7 @@ impl ::Decoder<DecoderError> for Decoder {
}
/// A trait for converting values to JSON
pub trait ToJson {
pub trait ToJson for Sized? {
/// Converts the value of `self` to an instance of JSON
fn to_json(&self) -> Json;
}
@ -2389,7 +2389,7 @@ tuple_impl!{A, B, C, D, E, F, G, H, I, J}
tuple_impl!{A, B, C, D, E, F, G, H, I, J, K}
tuple_impl!{A, B, C, D, E, F, G, H, I, J, K, L}
impl<'a, A: ToJson> ToJson for &'a [A] {
impl<A: ToJson> ToJson for [A] {
fn to_json(&self) -> Json { List(self.iter().map(|elt| elt.to_json()).collect()) }
}