summaryrefslogtreecommitdiffstats
path: root/src/config.rs
diff options
context:
space:
mode:
authorToby Vincent <tobyv13@gmail.com>2022-11-20 13:34:23 -0600
committerToby Vincent <tobyv13@gmail.com>2022-11-20 13:35:06 -0600
commit4b182e71598c2eda5190b81708bafe6f9681999b (patch)
tree7c0d906cf5fec687e2a7e551943b9277f330f085 /src/config.rs
parent597c19dfc08eae940a100a44a009d3169a6568f2 (diff)
feat: improve error handling
Diffstat (limited to 'src/config.rs')
-rw-r--r--src/config.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/config.rs b/src/config.rs
index 39c27fe..00aa1dc 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -12,6 +12,12 @@ pub struct Config {
}
impl Config {
+ // Provide a default provider, a `Figment`.
+ pub fn figment() -> Figment {
+ Figment::from(Config::default())
+ }
+
+ // Extract the configuration from any `Provider`
pub fn extract<T: Provider>(provider: T) -> figment::error::Result<Config> {
Figment::from(provider).extract()
}