diff --git a/README.md b/README.md index eccc9c8..fd30e8d 100644 --- a/README.md +++ b/README.md @@ -11,15 +11,14 @@ the configuration, which can be invoked with the following: use freedom_config::{Config, Test}; fn main() -> Result<(), Box> { - let config = Config::builder() - .environment(Test) - .key("my_key") - .secret("my_secret") - .build()?; - - println!("{:?}", config); - - Ok(()) + let config = Config::builder() + .environment(Test) + .key("my_key") + .secret("my_secret") + .build()?; + + println!("{:?}", config); + Ok(()) } ``` @@ -29,19 +28,19 @@ The builder can also be used to source these items from the environment: use freedom_config::Config; fn main() -> Result<(), Box> { - std::env::set_var(Config::ATLAS_ENV_VAR, "Test"); - std::env::set_var(Config::ATLAS_KEY_VAR, "my_key"); - std::env::set_var(Config::ATLAS_SECRET_VAR, "my_secret"); - - let config = Config::builder() - .environment_from_env()? - .key_from_env()? - .secret_from_env()? - .build()?; - - println!("{:?}", config); - - Ok(()) + std::env::set_var(Config::ATLAS_ENV_VAR, "Test"); + std::env::set_var(Config::ATLAS_KEY_VAR, "my_key"); + std::env::set_var(Config::ATLAS_SECRET_VAR, "my_secret"); + + let config = Config::builder() + .environment_from_env()? + .key_from_env()? + .secret_from_env()? + .build()?; + + println!("{:?}", config); + + Ok(()) } ``` @@ -52,6 +51,6 @@ config entirely from environment variables use freedom_config::Config; fn main() { - let config = Config::from_env(); + let config = Config::from_env(); } ```