diff --git a/.gitignore b/.gitignore index e77e33d..ce70b02 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ .idea/ +.vscode/ +.DS_Store /target /itconfig-tests/target diff --git a/README.md b/README.md index 60a2e7a..f0879cb 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,8 @@ config! { } fn main () { - // dotenv().ok(); + // dotenv().expect("dotenv setup to be successful"); + // or env::set_var("FEATURE_NEW_MENU", "t"); config::init(); @@ -96,9 +97,7 @@ fn main () { } ``` - -Macro is an optional feature, enabled by default. You can install itconfig without default -features and use this lib as shown below +Macro is an optional feature, disabled by default. You can use this library without macro ```rust use itconfig::*; @@ -106,6 +105,8 @@ use std::env; // use dotenv::dotenv; fn main() { + // dotenv().expect("dotenv setup to be successful"); + // or env::set_var("DATABASE_URL", "postgres://127.0.0.1:5432/test"); let database_url = get_env::("DATABASE_URL").unwrap(); diff --git a/examples/diesel/src/main.rs b/examples/diesel/src/main.rs index b734220..d8044dc 100644 --- a/examples/diesel/src/main.rs +++ b/examples/diesel/src/main.rs @@ -15,7 +15,7 @@ config! { } fn main() { - dotenv().ok(); + dotenv().expect("dotenv setup to be successful"); config::init(); let connection = db::establish_connection(); diff --git a/itconfig/README.md b/itconfig/README.md index 26fbd77..1d1322e 100644 --- a/itconfig/README.md +++ b/itconfig/README.md @@ -72,7 +72,8 @@ config! { } fn main () { - // dotenv().ok(); + // dotenv().expect("dotenv setup to be successful"); + // or env::set_var("FEATURE_NEW_MENU", "t"); config::init(); @@ -84,8 +85,7 @@ fn main () { ``` -Macro is an optional feature, enabled by default. You can install itconfig without default -features and use this lib as shown below +Macro is an optional feature, disabled by default. You can use this library without macro ```rust use itconfig::*; @@ -93,6 +93,8 @@ use std::env; // use dotenv::dotenv; fn main() { + // dotenv().expect("dotenv setup to be successful"); + // or env::set_var("DATABASE_URL", "postgres://127.0.0.1:5432/test"); let database_url = get_env::("DATABASE_URL").unwrap(); diff --git a/itconfig/src/lib.rs b/itconfig/src/lib.rs index 4d9d641..f449422 100644 --- a/itconfig/src/lib.rs +++ b/itconfig/src/lib.rs @@ -78,7 +78,8 @@ //! } //! //! fn main () { -//! // dotenv().ok(); +//! // dotenv().expect("dotenv setup to be successful"); +//! // or //! env::set_var("FEATURE_NEW_MENU", "t"); //! //! config::init(); @@ -90,8 +91,7 @@ //! } //! ``` //! -//! Macro is an optional feature, enabled by default. You can install itconfig without default -//! features and use this lib as shown below +//! Macro is an optional feature, disabled by default. You can use this library without macro. //! //! ```rust //! use itconfig::*; @@ -99,6 +99,8 @@ //! // use dotenv::dotenv; //! //! fn main() { +//! // dotenv().expect("dotenv setup to be successful"); +//! // or //! env::set_var("DATABASE_URL", "postgres://127.0.0.1:5432/test"); //! //! let database_url = get_env::("DATABASE_URL").unwrap();