Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Commit

Permalink
Resolve prelude redundant import warnings
Browse files Browse the repository at this point in the history
    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
  • Loading branch information
dtolnay committed Feb 19, 2024
1 parent 9e0b8d3 commit a52b7ac
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/mapping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
2 changes: 0 additions & 2 deletions src/value/from.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,6 @@ impl<'a, T: Clone + Into<Value>> From<&'a [T]> for Value {
}
}

use std::iter::FromIterator;

impl<T: Into<Value>> FromIterator<T> for Value {
/// Convert an iteratable type to a YAML sequence
///
Expand Down

0 comments on commit a52b7ac

Please sign in to comment.