From 938fd42200a2fc3e66c8f90b8d57b52c333d534d Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Wed, 31 Mar 2021 09:57:34 +0200 Subject: Remove unused imports Signed-off-by: Matthias Beyer --- src/config.rs | 8 +++----- src/error.rs | 1 - src/file/format/hjson.rs | 1 - src/file/format/ini.rs | 1 - src/file/format/json.rs | 1 - src/file/format/mod.rs | 1 - src/file/format/toml.rs | 3 +-- src/file/format/yaml.rs | 1 - src/file/source/file.rs | 3 --- src/file/source/mod.rs | 1 - src/file/source/string.rs | 6 +----- src/lib.rs | 2 -- src/path/mod.rs | 1 - src/path/parser.rs | 2 +- src/ser.rs | 2 -- 15 files changed, 6 insertions(+), 28 deletions(-) diff --git a/src/config.rs b/src/config.rs index 9a09a0a..b476ffe 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1,16 +1,14 @@ -use serde::de::{Deserialize, Deserializer}; -use serde::ser::{Serialize, Serializer}; +use serde::de::Deserialize; +use serde::ser::Serialize; use std::collections::HashMap; use std::fmt::Debug; -use std::ops::Deref; -use std::str::FromStr; use error::*; use ser::ConfigSerializer; use source::Source; use path; -use value::{Table, Value, ValueKind}; +use value::{Table, Value}; /// A prioritized configuration repository. It maintains a set of /// configuration sources, fetches values to populate those, and provides diff --git a/src/error.rs b/src/error.rs index deb79ee..e8babe6 100644 --- a/src/error.rs +++ b/src/error.rs @@ -1,7 +1,6 @@ use nom; use serde::de; use serde::ser; -use std::borrow::Cow; use std::error::Error; use std::fmt; use std::result; diff --git a/src/file/format/hjson.rs b/src/file/format/hjson.rs index 457cfbf..41631ea 100644 --- a/src/file/format/hjson.rs +++ b/src/file/format/hjson.rs @@ -1,5 +1,4 @@ use serde_hjson; -use source::Source; use std::collections::HashMap; use std::error::Error; use value::{Value, ValueKind}; diff --git a/src/file/format/ini.rs b/src/file/format/ini.rs index bc51def..0deefb5 100644 --- a/src/file/format/ini.rs +++ b/src/file/format/ini.rs @@ -1,5 +1,4 @@ use ini::Ini; -use source::Source; use std::collections::HashMap; use std::error::Error; use value::{Value, ValueKind}; diff --git a/src/file/format/json.rs b/src/file/format/json.rs index 0ff2beb..6a05051 100644 --- a/src/file/format/json.rs +++ b/src/file/format/json.rs @@ -1,5 +1,4 @@ use serde_json; -use source::Source; use std::collections::HashMap; use std::error::Error; use value::{Value, ValueKind}; diff --git a/src/file/format/mod.rs b/src/file/format/mod.rs index f46ae13..c6367c4 100644 --- a/src/file/format/mod.rs +++ b/src/file/format/mod.rs @@ -2,7 +2,6 @@ // BUG: ? For some reason this doesn't do anything if I try and function scope this #![allow(unused_mut)] -use source::Source; use std::collections::HashMap; use std::error::Error; use value::Value; diff --git a/src/file/format/toml.rs b/src/file/format/toml.rs index a40104e..409f73f 100644 --- a/src/file/format/toml.rs +++ b/src/file/format/toml.rs @@ -1,5 +1,4 @@ -use source::Source; -use std::collections::{BTreeMap, HashMap}; +use std::collections::HashMap; use std::error::Error; use toml; use value::{Value, ValueKind}; diff --git a/src/file/format/yaml.rs b/src/file/format/yaml.rs index c458c3c..18716f6 100644 --- a/src/file/format/yaml.rs +++ b/src/file/format/yaml.rs @@ -1,4 +1,3 @@ -use source::Source; use std::collections::HashMap; use std::error::Error; use std::fmt; diff --git a/src/file/source/file.rs b/src/file/source/file.rs index 804d108..12805fd 100644 --- a/src/file/source/file.rs +++ b/src/file/source/file.rs @@ -1,6 +1,4 @@ use std::error::Error; -use std::result; -use std::str::FromStr; use file::format::ALL_EXTENSIONS; use std::env; @@ -10,7 +8,6 @@ use std::iter::Iterator; use std::path::{Path, PathBuf}; use super::{FileFormat, FileSource}; -use source::Source; /// Describes a file sourced from a file #[derive(Clone, Debug)] diff --git a/src/file/source/mod.rs b/src/file/source/mod.rs index ab276d0..7d8e6a5 100644 --- a/src/file/source/mod.rs +++ b/src/file/source/mod.rs @@ -5,7 +5,6 @@ use std::error::Error; use std::fmt::Debug; use super::FileFormat; -use source::Source; /// Describes where the file is sourced pub trait FileSource: Debug + Clone { diff --git a/src/file/source/string.rs b/src/file/source/string.rs index 3896cce..cd2089d 100644 --- a/src/file/source/string.rs +++ b/src/file/source/string.rs @@ -1,9 +1,5 @@ -use std::error::Error; -use std::result; -use std::str::FromStr; - use super::{FileFormat, FileSource}; -use source::Source; +use std::error::Error; /// Describes a file sourced from a string #[derive(Clone, Debug)] diff --git a/src/lib.rs b/src/lib.rs index b591c9b..9603118 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -17,7 +17,6 @@ //! //! See the [examples](https://github.com/mehcode/config-rs/tree/master/examples) for //! general usage information. -#![allow(unused_imports)] #![allow(unused_variables)] #![allow(unknown_lints)] // #![warn(missing_docs)] @@ -29,7 +28,6 @@ extern crate serde; #[macro_use] extern crate serde_derive; -#[macro_use] extern crate nom; #[macro_use] diff --git a/src/path/mod.rs b/src/path/mod.rs index ac28400..c6de2a7 100644 --- a/src/path/mod.rs +++ b/src/path/mod.rs @@ -1,5 +1,4 @@ use error::*; -use nom::error::ErrorKind; use std::collections::HashMap; use std::str::FromStr; use value::{Value, ValueKind}; diff --git a/src/path/parser.rs b/src/path/parser.rs index 7a40cb5..6c873cb 100644 --- a/src/path/parser.rs +++ b/src/path/parser.rs @@ -8,7 +8,7 @@ use nom::{ sequence::{delimited, pair, preceded}, Err, IResult, }; -use std::str::{from_utf8, FromStr}; +use std::str::FromStr; fn raw_ident(i: &str) -> IResult<&str, String> { map( diff --git a/src/ser.rs b/src/ser.rs index 39c02b9..1113226 100644 --- a/src/ser.rs +++ b/src/ser.rs @@ -1,6 +1,5 @@ use serde::ser; use std::fmt::Display; -use std::mem; use error::*; use value::{Value, ValueKind}; @@ -696,7 +695,6 @@ impl ser::SerializeStructVariant for StringKeySerializer { #[cfg(test)] mod test { use super::*; - use serde::Serialize; #[test] fn test_struct() { -- cgit v1.2.3