2 releases
0.1.1 | Mar 19, 2023 |
---|---|
0.1.0 | Mar 16, 2023 |
#74 in #named
29 downloads per month
4KB
54 lines
get_config
pub fn main() {
// There should be either:
// - a file named `config.toml` in the current directory;
// - a path passed to `std::env::args().nth(1)`.
let config: Config = get_config().unwrap();
println!("{:?}", config);
}
// `Deserialize` is required by `cargo add serde --features derive`
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize)]
struct Config {
hello: String,
}
Dependencies
~0.5–1.1MB
~25K SLoC