Skip to content

Commit 0e65187

Browse files
committed
Simplify impl From<Vec<T>> for ValueKind
Signed-off-by: Matthias Beyer <[email protected]>
1 parent 77e9564 commit 0e65187

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/value.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,7 @@ where
8282
T: Into<Value>,
8383
{
8484
fn from(values: Vec<T>) -> Self {
85-
let mut l = Vec::new();
86-
87-
for v in values {
88-
l.push(v.into());
89-
}
90-
91-
ValueKind::Array(l)
85+
ValueKind::Array(values.into_iter().map(T::into).collect())
9286
}
9387
}
9488

0 commit comments

Comments
 (0)