#config #configuration

adhoc-figment

An ad hoc provider for figment

2 releases

0.1.1 Sep 10, 2021
0.1.0 Sep 7, 2021

#67 in #config

MIT license

5KB
68 lines

Ad Hoc Figment

An ad hoc provider for the figment configuration library.

use figment::Figment;
use adhoc_figment::AdHocProvider;

fn main() {
    let ad_hoc = AdHocProvider::new("key", "value");
    let figment = Figment::from(ad_hoc);
    let value: String = figment.extract_inner("key").unwrap();
    assert_eq!(value, "value");
}

Dependencies

;a