diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/glob/Cargo.toml | 1 | ||||
-rw-r--r-- | examples/glob/src/main.rs | 3 | ||||
-rw-r--r-- | examples/global/Cargo.toml | 1 | ||||
-rw-r--r-- | examples/hierarchical-env/Cargo.toml | 1 | ||||
-rw-r--r-- | examples/hierarchical-env/src/settings.rs | 2 | ||||
-rw-r--r-- | examples/simple/Cargo.toml | 1 | ||||
-rw-r--r-- | examples/simple/src/main.rs | 2 | ||||
-rw-r--r-- | examples/watch/Cargo.toml | 1 | ||||
-rw-r--r-- | examples/watch/src/main.rs | 8 |
9 files changed, 7 insertions, 13 deletions
diff --git a/examples/glob/Cargo.toml b/examples/glob/Cargo.toml index c4b042e..32b7ba3 100644 --- a/examples/glob/Cargo.toml +++ b/examples/glob/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "glob" version = "0.1.0" +edition = "2018" [dependencies] config = { path = "../../" } diff --git a/examples/glob/src/main.rs b/examples/glob/src/main.rs index 112335c..b3183ef 100644 --- a/examples/glob/src/main.rs +++ b/examples/glob/src/main.rs @@ -1,6 +1,3 @@ -extern crate glob; -extern crate config; - use std::path::Path; use std::collections::HashMap; use config::*; diff --git a/examples/global/Cargo.toml b/examples/global/Cargo.toml index ec24740..dacbfe2 100644 --- a/examples/global/Cargo.toml +++ b/examples/global/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "global" version = "0.1.0" +edition = "2018" [dependencies] config = { path = "../../" } diff --git a/examples/hierarchical-env/Cargo.toml b/examples/hierarchical-env/Cargo.toml index bbcd4a6..421d10d 100644 --- a/examples/hierarchical-env/Cargo.toml +++ b/examples/hierarchical-env/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "hierarchical-env" version = "0.1.0" +edition = "2018" [dependencies] config = { path = "../../" } diff --git a/examples/hierarchical-env/src/settings.rs b/examples/hierarchical-env/src/settings.rs index ad23163..0fa59d2 100644 --- a/examples/hierarchical-env/src/settings.rs +++ b/examples/hierarchical-env/src/settings.rs @@ -38,7 +38,7 @@ pub struct Settings { impl Settings { pub fn new() -> Result<Self, ConfigError> { - let mut s = Config::new(); + let mut s = Config::default(); // Start off by merging in the "default" configuration file s.merge(File::with_name("config/default"))?; diff --git a/examples/simple/Cargo.toml b/examples/simple/Cargo.toml index 196f742..f1d8097 100644 --- a/examples/simple/Cargo.toml +++ b/examples/simple/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "simple" version = "0.1.0" +edition = "2018" [dependencies] config = { path = "../../" } diff --git a/examples/simple/src/main.rs b/examples/simple/src/main.rs index 7e7ca31..1c7ddb7 100644 --- a/examples/simple/src/main.rs +++ b/examples/simple/src/main.rs @@ -1,5 +1,3 @@ -extern crate config; - use std::collections::HashMap; fn main() { diff --git a/examples/watch/Cargo.toml b/examples/watch/Cargo.toml index 8c8a505..36b2880 100644 --- a/examples/watch/Cargo.toml +++ b/examples/watch/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "watch" version = "0.1.0" +edition = "2018" [dependencies] config = { path = "../../" } diff --git a/examples/watch/src/main.rs b/examples/watch/src/main.rs index 3f08e94..a197390 100644 --- a/examples/watch/src/main.rs +++ b/examples/watch/src/main.rs @@ -1,9 +1,3 @@ -extern crate config; -extern crate notify; - -#[macro_use] -extern crate lazy_static; - use config::*; use std::collections::HashMap; use std::sync::RwLock; @@ -11,7 +5,7 @@ use notify::{RecommendedWatcher, DebouncedEvent, Watcher, RecursiveMode}; use std::sync::mpsc::channel; use std::time::Duration; -lazy_static! { +lazy_static::lazy_static! { static ref SETTINGS: RwLock<Config> = RwLock::new({ let mut settings = Config::default(); settings.merge(File::with_name("Settings.toml")).unwrap(); |