From 4b182e71598c2eda5190b81708bafe6f9681999b Mon Sep 17 00:00:00 2001 From: Toby Vincent Date: Sun, 20 Nov 2022 13:34:23 -0600 Subject: feat: improve error handling --- src/config.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/config.rs') 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(provider: T) -> figment::error::Result { Figment::from(provider).extract() } -- cgit v1.2.3-70-g09d2