summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkpcyrd <git@rxv.cc>2021-05-06 17:37:28 +0200
committerkpcyrd <git@rxv.cc>2021-05-07 16:33:37 +0200
commite57d716e5c88057b652fe52d4fc6f6518b4758e1 (patch)
tree029cc66d4f58a83c53a6700e57d3f48ab0b3851e
parent86f87764fed802f876a7b8bf1fc7f824c28d28c8 (diff)
Update to rust 2018 edition
-rw-r--r--Cargo.toml1
-rw-r--r--examples/glob/Cargo.toml1
-rw-r--r--examples/glob/src/main.rs3
-rw-r--r--examples/global/Cargo.toml1
-rw-r--r--examples/hierarchical-env/Cargo.toml1
-rw-r--r--examples/hierarchical-env/src/settings.rs2
-rw-r--r--examples/simple/Cargo.toml1
-rw-r--r--examples/simple/src/main.rs2
-rw-r--r--examples/watch/Cargo.toml1
-rw-r--r--examples/watch/src/main.rs8
-rw-r--r--src/error.rs1
-rw-r--r--src/file/format/hjson.rs2
-rw-r--r--src/file/format/json.rs2
-rw-r--r--src/file/format/ron.rs2
-rw-r--r--src/file/format/toml.rs2
-rw-r--r--src/lib.rs12
16 files changed, 14 insertions, 28 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 040124f..abec5bd 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -9,6 +9,7 @@ keywords = ["config", "configuration", "settings", "env", "environment"]
authors = ["Ryan Leckey <leckey.ryan@gmail.com>"]
categories = ["config"]
license = "MIT/Apache-2.0"
+edition = "2018"
[badges]
maintenance = { status = "actively-developed" }
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();
diff --git a/src/error.rs b/src/error.rs
index c7578d8..28142b5 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -2,7 +2,6 @@ use std::error::Error;
use std::fmt;
use std::result;
-use nom;
use serde::de;
use serde::ser;
diff --git a/src/file/format/hjson.rs b/src/file/format/hjson.rs
index 8a1e474..f94b1d3 100644
--- a/src/file/format/hjson.rs
+++ b/src/file/format/hjson.rs
@@ -1,8 +1,6 @@
use std::collections::HashMap;
use std::error::Error;
-use serde_hjson;
-
use crate::value::{Value, ValueKind};
pub fn parse(
diff --git a/src/file/format/json.rs b/src/file/format/json.rs
index 568a16b..87a6e61 100644
--- a/src/file/format/json.rs
+++ b/src/file/format/json.rs
@@ -1,8 +1,6 @@
use std::collections::HashMap;
use std::error::Error;
-use serde_json;
-
use crate::value::{Value, ValueKind};
pub fn parse(
diff --git a/src/file/format/ron.rs b/src/file/format/ron.rs
index d3a97cb..f7dbce3 100644
--- a/src/file/format/ron.rs
+++ b/src/file/format/ron.rs
@@ -1,8 +1,6 @@
use std::collections::HashMap;
use std::error::Error;
-use ron;
-
use crate::value::{Value, ValueKind};
pub fn parse(
diff --git a/src/file/format/toml.rs b/src/file/format/toml.rs
index c5b7a7d..c7c5972 100644
--- a/src/file/format/toml.rs
+++ b/src/file/format/toml.rs
@@ -1,8 +1,6 @@
use std::collections::HashMap;
use std::error::Error;
-use toml;
-
use crate::value::{Value, ValueKind};
pub fn parse(
diff --git a/src/lib.rs b/src/lib.rs
index 03a82c1..2dbd7b8 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -61,9 +61,9 @@ mod ser;
mod source;
mod value;
-pub use config::Config;
-pub use env::Environment;
-pub use error::ConfigError;
-pub use file::{File, FileFormat, FileSourceFile, FileSourceString};
-pub use source::Source;
-pub use value::Value;
+pub use crate::config::Config;
+pub use crate::env::Environment;
+pub use crate::error::ConfigError;
+pub use crate::file::{File, FileFormat, FileSourceFile, FileSourceString};
+pub use crate::source::Source;
+pub use crate::value::Value;