@@ -59,11 +59,11 @@ pub enum AnyValue {
59
59
/// A boolean value
60
60
Boolean ( bool ) ,
61
61
/// A byte array
62
- Bytes ( Vec < u8 > ) ,
62
+ Bytes ( Box < Vec < u8 > > ) ,
63
63
/// An array of `Any` values
64
- ListAny ( Vec < AnyValue > ) ,
64
+ ListAny ( Box < Vec < AnyValue > > ) ,
65
65
/// A map of string keys to `Any` values, arbitrarily nested.
66
- Map ( HashMap < Key , AnyValue > ) ,
66
+ Map ( Box < HashMap < Key , AnyValue > > ) ,
67
67
}
68
68
69
69
macro_rules! impl_trivial_from {
@@ -98,17 +98,17 @@ impl_trivial_from!(bool, AnyValue::Boolean);
98
98
impl < T : Into < AnyValue > > FromIterator < T > for AnyValue {
99
99
/// Creates an [`AnyValue::ListAny`] value from a sequence of `Into<AnyValue>` values.
100
100
fn from_iter < I : IntoIterator < Item = T > > ( iter : I ) -> Self {
101
- AnyValue :: ListAny ( iter. into_iter ( ) . map ( Into :: into) . collect ( ) )
101
+ AnyValue :: ListAny ( Box :: new ( iter. into_iter ( ) . map ( Into :: into) . collect ( ) ) )
102
102
}
103
103
}
104
104
105
105
impl < K : Into < Key > , V : Into < AnyValue > > FromIterator < ( K , V ) > for AnyValue {
106
106
/// Creates an [`AnyValue::Map`] value from a sequence of key-value pairs
107
107
/// that can be converted into a `Key` and `AnyValue` respectively.
108
108
fn from_iter < I : IntoIterator < Item = ( K , V ) > > ( iter : I ) -> Self {
109
- AnyValue :: Map ( HashMap :: from_iter (
109
+ AnyValue :: Map ( Box :: new ( HashMap :: from_iter (
110
110
iter. into_iter ( ) . map ( |( k, v) | ( k. into ( ) , v. into ( ) ) ) ,
111
- ) )
111
+ ) ) )
112
112
}
113
113
}
114
114
0 commit comments