Skip to content

Commit 8f270bb

Browse files
committed
Box Array
1 parent 4bb262c commit 8f270bb

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/value.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ pub enum Value {
200200

201201
#[cfg(feature = "postgres-array")]
202202
#[cfg_attr(docsrs, doc(cfg(feature = "postgres-array")))]
203-
Array(ArrayType, Option<Vec<Value>>),
203+
Array(ArrayType, Option<Box<Vec<Value>>>),
204204

205205
#[cfg(feature = "postgres-vector")]
206206
#[cfg_attr(docsrs, doc(cfg(feature = "postgres-vector")))]
@@ -1045,7 +1045,7 @@ pub mod with_array {
10451045
fn from(x: Vec<T>) -> Value {
10461046
Value::Array(
10471047
T::array_type(),
1048-
Some(x.into_iter().map(|e| e.into()).collect()),
1048+
Some(Box::new(x.into_iter().map(|e| e.into()).collect())),
10491049
)
10501050
}
10511051
}
@@ -1690,7 +1690,9 @@ pub fn sea_value_to_json_value(value: &Value) -> Json {
16901690
#[cfg(feature = "with-uuid")]
16911691
Value::Uuid(Some(v)) => Json::String(v.to_string()),
16921692
#[cfg(feature = "postgres-array")]
1693-
Value::Array(_, Some(v)) => Json::Array(v.iter().map(sea_value_to_json_value).collect()),
1693+
Value::Array(_, Some(v)) => {
1694+
Json::Array(v.as_ref().iter().map(sea_value_to_json_value).collect())
1695+
}
16941696
#[cfg(feature = "postgres-vector")]
16951697
Value::Vector(Some(v)) => Json::Array(v.as_slice().iter().map(|&v| v.into()).collect()),
16961698
#[cfg(feature = "with-ipnetwork")]
@@ -2458,6 +2460,7 @@ mod hashable_value {
24582460
Value::Int(Some(1)),
24592461
Value::Int(Some(2))
24602462
])
2463+
.into()
24612464
)
24622465
)
24632466
);
@@ -2472,6 +2475,7 @@ mod hashable_value {
24722475
Value::Float(Some(1.0)),
24732476
Value::Float(Some(2.0))
24742477
])
2478+
.into()
24752479
)
24762480
)
24772481
);

0 commit comments

Comments
 (0)