diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2021-03-31 15:33:51 +0200 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2021-04-01 17:01:26 +0200 |
commit | 0e651879939ca18b7ce38ffb306c85a183deb67b (patch) | |
tree | 76748c43ef8964a3392c8a829801f8dd0fada99f /src/value.rs | |
parent | 77e9564bca18dbea27abcbf9ba2e35b0b0511784 (diff) |
Simplify impl From<Vec<T>> for ValueKind
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'src/value.rs')
-rw-r--r-- | src/value.rs | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/value.rs b/src/value.rs index e07239e..2c0873c 100644 --- a/src/value.rs +++ b/src/value.rs @@ -82,13 +82,7 @@ where T: Into<Value>, { fn from(values: Vec<T>) -> Self { - let mut l = Vec::new(); - - for v in values { - l.push(v.into()); - } - - ValueKind::Array(l) + ValueKind::Array(values.into_iter().map(T::into).collect()) } } |