From f3b6fd435478a129dbf6ede37d8881c7a55efc42 Mon Sep 17 00:00:00 2001 From: Ryan Leckey Date: Fri, 27 Jan 2017 11:14:28 -0800 Subject: Move 'Envrionment' into its own source --- src/lib.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index 99a6da3..0fa3d70 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -10,6 +10,7 @@ extern crate serde_json; mod value; mod source; mod file; +mod env; mod config; use std::error::Error; @@ -17,6 +18,7 @@ use std::sync::{Once, ONCE_INIT}; pub use source::{Source, SourceBuilder}; pub use file::{File, FileFormat}; +pub use env::Environment; pub use value::Value; @@ -29,9 +31,7 @@ static CONFIG_INIT: Once = ONCE_INIT; // Get the global configuration instance fn global() -> &'static mut Config { unsafe { - CONFIG_INIT.call_once(|| { - CONFIG = Some(Default::default()); - }); + CONFIG_INIT.call_once(|| { CONFIG = Some(Default::default()); }); CONFIG.as_mut().unwrap() } @@ -43,10 +43,6 @@ pub fn merge(source: T) -> Result<(), Box> global().merge(source) } -pub fn set_env_prefix(prefix: &str) { - global().set_env_prefix(prefix) -} - pub fn set_default(key: &str, value: T) where T: Into { -- cgit v1.2.3