5 releases
0.1.4 | Apr 20, 2022 |
---|---|
0.1.3 | Apr 20, 2022 |
0.1.2 | Apr 20, 2022 |
0.1.1 | Apr 20, 2022 |
0.1.0 | Apr 20, 2022 |
#40 in #config-toml
4KB
Confiture
Confiture is a really simple crate to manage config from toml file.
Usage
#[derive(Serialize, Deserialize, Debug, Default)]
#[serde(default)]
struct Config {
title: String,
}
fn main() {
let mut cfg = Config::from_toml_file("config.toml").unwrap();
cfg.title = String::from("Jean");
cfg.save_to_file("config.toml").unwrap();
}
lib.rs
:
Usage :
#[derive(Serialize, Deserialize, Debug, Default)]
#[serde(default)]
struct Config {
title: String,
}
fn main() {
let mut cfg = Config::from_toml_file("config.toml").unwrap();
cfg.title = String::from("Jean");
cfg.save_to_file("config.toml").unwrap();
}
Dependencies
~0.5–1MB
~24K SLoC