From a52b7ac3f42aad7f587409d2e431ed2fe5db7b31 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sun, 18 Feb 2024 21:21:04 -0800 Subject: [PATCH] Resolve prelude redundant import warnings warning: the item `FromIterator` is imported redundantly --> src/mapping.rs:10:5 | 10 | use std::iter::FromIterator; | ^^^^^^^^^^^^^^^^^^^^^^^ | ::: nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/prelude/mod.rs:129:13 | 129 | pub use core::prelude::rust_2021::*; | ------------------------ the item `FromIterator` is already defined here | = note: `#[warn(unused_imports)]` on by default warning: the item `FromIterator` is imported redundantly --> src/value/from.rs:148:5 | 148 | use std::iter::FromIterator; | ^^^^^^^^^^^^^^^^^^^^^^^ | ::: nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/prelude/mod.rs:129:13 | 129 | pub use core::prelude::rust_2021::*; | ------------------------ the item `FromIterator` is already defined here --- src/mapping.rs | 1 - src/value/from.rs | 2 -- 2 files changed, 3 deletions(-) diff --git a/src/mapping.rs b/src/mapping.rs index 552733d0..667cd4b4 100644 --- a/src/mapping.rs +++ b/src/mapping.rs @@ -7,7 +7,6 @@ use std::cmp::Ordering; use std::collections::hash_map::DefaultHasher; use std::fmt::{self, Display}; use std::hash::{Hash, Hasher}; -use std::iter::FromIterator; use std::mem; /// A YAML mapping in which the keys and values are both `serde_yaml::Value`. diff --git a/src/value/from.rs b/src/value/from.rs index c02855d3..82412c4f 100644 --- a/src/value/from.rs +++ b/src/value/from.rs @@ -145,8 +145,6 @@ impl<'a, T: Clone + Into> From<&'a [T]> for Value { } } -use std::iter::FromIterator; - impl> FromIterator for Value { /// Convert an iteratable type to a YAML sequence ///