recipe: derive PartialEq for a bunch of types

This commit is contained in:
Sebastian Kuzminsky 2025-02-09 13:49:42 -07:00
parent 5cf35ca450
commit 2c1f331523

View file

@ -32,7 +32,7 @@ impl std::fmt::Debug for Quantity {
} }
} }
#[derive(Debug, serde::Deserialize)] #[derive(Debug, serde::Deserialize, PartialEq)]
pub struct Input { pub struct Input {
// Quantity defaults to "amount=1" if omitted. // Quantity defaults to "amount=1" if omitted.
#[serde(default)] #[serde(default)]
@ -46,24 +46,24 @@ pub struct Output {
pub quantity: Quantity, pub quantity: Quantity,
} }
#[derive(Debug, serde::Deserialize)] #[derive(Debug, serde::Deserialize, PartialEq)]
pub struct Operator { pub struct Operator {
pub skills: Vec<String>, pub skills: Vec<String>,
} }
#[derive(Debug, serde::Deserialize)] #[derive(Debug, serde::Deserialize, PartialEq)]
pub struct Dependencies { pub struct Dependencies {
pub tools: Option<Vec<String>>, pub tools: Option<Vec<String>>,
pub operator: Option<Operator>, pub operator: Option<Operator>,
} }
#[derive(Debug, serde::Deserialize)] #[derive(Debug, serde::Deserialize, PartialEq)]
pub struct Purchase { pub struct Purchase {
pub vendor: Vec<String>, pub vendor: Vec<String>,
pub documentation: Option<Vec<String>>, pub documentation: Option<Vec<String>>,
} }
#[derive(Debug, serde::Deserialize)] #[derive(Debug, serde::Deserialize, PartialEq)]
#[allow(non_camel_case_types)] #[allow(non_camel_case_types)]
pub enum Action { pub enum Action {
process(String), process(String),
@ -71,7 +71,7 @@ pub enum Action {
purchase(Purchase), purchase(Purchase),
} }
#[derive(Debug, serde::Deserialize)] #[derive(Debug, serde::Deserialize, PartialEq)]
pub struct Recipe { pub struct Recipe {
/// `[inputs]` is a Table where each key the the name (unique id) /// `[inputs]` is a Table where each key the the name (unique id)
/// of a recipe in the repo, and the value is an Input object. /// of a recipe in the repo, and the value is an Input object.