Created
January 10, 2024 13:17
-
-
Save isaacssemugenyi/3552af0da54aaab14c23d2da3517ebde to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// config with dotenv | |
impl Config { | |
pub fn from_env() -> Result<Self, ConfigError> { | |
let s = config::Config::builder() | |
.add_source(config::Environment::default()) | |
.build()?; | |
s.try_deserialize() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment