From 4864795d5c8bc32a43807f48bc376c4ea27d5c0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?A=CC=81rpa=CC=81d=20Goretity?= Date: Sun, 21 Jan 2018 09:21:44 +0100 Subject: [PATCH] Simplify impl FromIterator for Value::Array, and make it look consistent with the rest of the From impls --- src/value/from.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/value/from.rs b/src/value/from.rs index 72d94c7..0afefd3 100644 --- a/src/value/from.rs +++ b/src/value/from.rs @@ -261,8 +261,6 @@ impl> ::std::iter::FromIterator for Value { /// # } /// ``` fn from_iter>(iter: I) -> Self { - let vec: Vec = iter.into_iter().map(|x| x.into()).collect(); - - Value::Array(vec) + Value::Array(iter.into_iter().map(Into::into).collect()) } }