mirror of
https://github.com/serde-rs/json.git
synced 2026-03-14 02:07:40 +00:00
Simplify impl FromIterator for Value::Array, and make it look consistent with the rest of the From<Collection> impls
This commit is contained in:
parent
75ffe41476
commit
4864795d5c
@ -261,8 +261,6 @@ impl<T: Into<Value>> ::std::iter::FromIterator<T> for Value {
|
||||
/// # }
|
||||
/// ```
|
||||
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self {
|
||||
let vec: Vec<Value> = iter.into_iter().map(|x| x.into()).collect();
|
||||
|
||||
Value::Array(vec)
|
||||
Value::Array(iter.into_iter().map(Into::into).collect())
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user