diff --git a/tools/src/recipe.rs b/tools/src/recipe.rs index ddb53ad..bb77321 100644 --- a/tools/src/recipe.rs +++ b/tools/src/recipe.rs @@ -1,3 +1,11 @@ +#[derive(Debug, thiserror::Error)] +pub enum RecipeLoadError { + #[error(transparent)] + StdIoError(#[from] std::io::Error), + #[error(transparent)] + TomlDeserializeError(#[from] toml::de::Error), +} + #[derive(Clone, Copy, Debug, PartialEq, serde::Deserialize)] pub enum Unit { Foot, @@ -91,7 +99,7 @@ pub struct Recipe { } impl Recipe { - pub fn from_file(file: &std::path::PathBuf) -> anyhow::Result { + pub fn from_file(file: &std::path::PathBuf) -> Result { let recipe_contents = std::fs::read_to_string(file)?; let mut recipe: Recipe = toml::from_str(&recipe_contents)?; if recipe.outputs == None {