Skip to content

Commit 43f3a34

Browse files
committed
style: Make imports consistent
1 parent 08b82de commit 43f3a34

31 files changed

+49
-58
lines changed

examples/async_source/main.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
use std::{error::Error, fmt::Debug};
22

3+
use async_trait::async_trait;
34
use config::{
45
builder::AsyncState, AsyncSource, ConfigBuilder, ConfigError, FileFormat, Format, Map,
56
};
6-
7-
use async_trait::async_trait;
87
use futures::{select, FutureExt};
98
use warp::Filter;
109

examples/custom_file_format/main.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
use config::{Config, File, FileStoredFormat, Format, Map, Value, ValueKind};
21
use std::io::{Error, ErrorKind};
32

3+
use config::{Config, File, FileStoredFormat, Format, Map, Value, ValueKind};
4+
45
/// The private and public key sources will be read into their associated variable:
56
#[derive(serde_derive::Deserialize, Clone, Debug)]
67
pub struct Settings {

examples/glob/main.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
use config::{Config, File};
2-
use glob::glob;
31
use std::collections::HashMap;
42
use std::path::Path;
53

4+
use config::{Config, File};
5+
use glob::glob;
6+
67
fn main() {
78
// Option 1
89
// --------

examples/global/main.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
#![allow(deprecated)]
2-
use config::Config;
32
use std::error::Error;
43
use std::sync::OnceLock;
54
use std::sync::RwLock;
65

6+
use config::Config;
7+
78
fn settings() -> &'static RwLock<Config> {
89
static CONFIG: OnceLock<RwLock<Config>> = OnceLock::new();
910
CONFIG.get_or_init(|| RwLock::new(Config::default()))

examples/hierarchical-env/settings.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
use std::env;
2+
13
use config::{Config, ConfigError, Environment, File};
24
use serde_derive::Deserialize;
3-
use std::env;
45

56
#[derive(Debug, Deserialize)]
67
#[allow(unused)]

examples/simple/main.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
use config::Config;
21
use std::collections::HashMap;
32

3+
use config::Config;
4+
45
fn main() {
56
let settings = Config::builder()
67
// Add in `./Settings.toml`

examples/watch/main.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
#![allow(deprecated)]
2-
use config::{Config, File};
3-
use notify::{Event, RecommendedWatcher, RecursiveMode, Watcher};
42
use std::collections::HashMap;
53
use std::path::Path;
64
use std::sync::mpsc::channel;
75
use std::sync::OnceLock;
86
use std::sync::RwLock;
97
use std::time::Duration;
108

9+
use config::{Config, File};
10+
use notify::{Event, RecommendedWatcher, RecursiveMode, Watcher};
11+
1112
fn settings() -> &'static RwLock<Config> {
1213
static CONFIG: OnceLock<RwLock<Config>> = OnceLock::new();
1314
CONFIG.get_or_init(|| {

src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
use std::fmt::Debug;
22

3-
use crate::builder::{ConfigBuilder, DefaultState};
43
use serde::de::Deserialize;
54
use serde::ser::Serialize;
65

6+
use crate::builder::{ConfigBuilder, DefaultState};
77
use crate::error::{ConfigError, Result};
88
use crate::map::Map;
99
use crate::path;

src/env.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
use std::env;
22

3+
#[cfg(feature = "convert-case")]
4+
use convert_case::{Case, Casing};
5+
36
use crate::error::Result;
47
use crate::map::Map;
58
use crate::source::Source;
69
use crate::value::{Value, ValueKind};
710

8-
#[cfg(feature = "convert-case")]
9-
use convert_case::{Case, Casing};
10-
1111
/// An environment source collects a dictionary of environment variables values into a hierarchical
1212
/// config Value type. We have to be aware how the config tree is created from the environment
1313
/// dictionary, therefore we are mindful about prefixes for the environment keys, level separators,

src/file/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,14 @@ pub(crate) mod source;
44
use std::fmt::Debug;
55
use std::path::{Path, PathBuf};
66

7+
use self::source::FileSource;
78
use crate::error::{ConfigError, Result};
89
use crate::map::Map;
910
use crate::source::Source;
1011
use crate::value::Value;
1112
use crate::Format;
1213

1314
pub use self::format::FileFormat;
14-
use self::source::FileSource;
15-
1615
pub use self::source::file::FileSourceFile;
1716
pub use self::source::string::FileSourceString;
1817

0 commit comments

Comments
 (0)