use serde::Deserialize;
#[derive(Deserialize, Default)]
pub struct Config {
pub export: Export,
}
impl Config {
pub fn load(filename: &std::path::Path) -> anyhow::Result<Self> {
let content = std::fs::read_to_string(filename)?;
Ok(toml::from_str(&content)?)
}
}
#[derive(Deserialize)]
pub struct Export {
pub sketch: String,
pub part: String,
}
impl Default for Export {
fn default() -> Self {
Self {
sketch: "svg".into(),
part: "stl".into(),
}
}
}