From 7f3f9f0bf18ba9c48b7b62d4825a2932b6b0c68d Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Thu, 29 Jul 2021 16:53:42 +0200 Subject: feat: make login --- src/config.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/config.rs (limited to 'src/config.rs') diff --git a/src/config.rs b/src/config.rs new file mode 100644 index 0000000..83ed7bd --- /dev/null +++ b/src/config.rs @@ -0,0 +1,16 @@ +pub use config::ConfigError; +use serde::Deserialize; + +#[derive(Deserialize, Debug)] +pub struct Config { + pub cf: String, + pub password: String, +} + +impl Config { + pub fn from_env() -> Result { + let mut cfg = config::Config::new(); + cfg.merge(config::Environment::new())?; + cfg.try_into() + } +} -- cgit v1.2.3-18-g5258