Skip to content

Commit bff7423

Browse files
committed
Unbox rest
1 parent 586a84c commit bff7423

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

src/value.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,11 +300,11 @@ pub enum Value {
300300

301301
#[cfg(feature = "with-bigdecimal")]
302302
#[cfg_attr(docsrs, doc(cfg(feature = "with-bigdecimal")))]
303-
BigDecimal(Option<Box<BigDecimal>>),
303+
BigDecimal(Option<BigDecimal>),
304304

305305
#[cfg(feature = "postgres-array")]
306306
#[cfg_attr(docsrs, doc(cfg(feature = "postgres-array")))]
307-
Array(ArrayType, Option<Box<Vec<Value>>>),
307+
Array(ArrayType, Option<Vec<Value>>),
308308

309309
#[cfg(feature = "postgres-vector")]
310310
#[cfg_attr(docsrs, doc(cfg(feature = "postgres-vector")))]

src/value/hashable_value.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -328,23 +328,23 @@ mod tests {
328328
Into::<Value>::into(vec![0i32, 1, 2]),
329329
Value::Array(
330330
ArrayType::Int,
331-
Some(Box::new(vec![
331+
Some(vec![
332332
Value::Int(Some(0)),
333333
Value::Int(Some(1)),
334334
Value::Int(Some(2))
335-
]))
335+
])
336336
)
337337
);
338338

339339
assert_eq!(
340340
Into::<Value>::into(vec![0f32, 1.0, 2.0]),
341341
Value::Array(
342342
ArrayType::Float,
343-
Some(Box::new(vec![
343+
Some(vec![
344344
Value::Float(Some(0f32)),
345345
Value::Float(Some(1.0)),
346346
Value::Float(Some(2.0))
347-
]))
347+
])
348348
)
349349
);
350350

src/value/with_array.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ where
8383
fn from(x: Vec<T>) -> Value {
8484
Value::Array(
8585
T::array_type(),
86-
Some(Box::new(x.into_iter().map(|e| e.into()).collect())),
86+
Some(x.into_iter().map(|e| e.into()).collect()),
8787
)
8888
}
8989
}
@@ -131,7 +131,7 @@ impl Value {
131131

132132
pub fn as_ref_array(&self) -> Option<&Vec<Value>> {
133133
match self {
134-
Self::Array(_, v) => v.as_ref().map(|v| v.as_ref()),
134+
Self::Array(_, v) => v.as_ref(),
135135
_ => panic!("not Value::Array"),
136136
}
137137
}

src/value/with_bigdecimal.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use super::*;
22

3-
type_to_box_value!(BigDecimal, BigDecimal, Decimal(None));
3+
type_to_value!(BigDecimal, BigDecimal, Decimal(None));
44

55
impl Value {
66
pub fn is_big_decimal(&self) -> bool {
@@ -9,7 +9,7 @@ impl Value {
99

1010
pub fn as_ref_big_decimal(&self) -> Option<&BigDecimal> {
1111
match self {
12-
Self::BigDecimal(v) => v.as_ref().map(|x| x.as_ref()),
12+
Self::BigDecimal(v) => v.as_ref(),
1313
_ => panic!("not Value::BigDecimal"),
1414
}
1515
}

0 commit comments

Comments
 (0)