diff --git a/crates/recipe-parser/Cargo.toml b/crates/recipe-parser/Cargo.toml index 9019095..5444994 100644 --- a/crates/recipe-parser/Cargo.toml +++ b/crates/recipe-parser/Cargo.toml @@ -12,7 +12,7 @@ homepage = { workspace = true } categories = ["command-line-interface", "parser-implementations"] [dependencies] -serde = { version = "1.0", features = ["derive"] } +serde = { version = "1", features = ["derive"], optional = true } winnow = "0.6.6" [dev-dependencies] @@ -21,3 +21,6 @@ serde_json = "1.0" [lib] path = "src/lib.rs" + +[features] +serde = ["dep:serde"] diff --git a/crates/recipe-parser/src/parser.rs b/crates/recipe-parser/src/parser.rs index 1a66ffb..d332081 100644 --- a/crates/recipe-parser/src/parser.rs +++ b/crates/recipe-parser/src/parser.rs @@ -193,6 +193,7 @@ fn parse_backstory<'a>(input: &mut Input<'a>) -> PResult<&'a str> { **************** */ #[derive(Debug, Clone, Eq, PartialEq, Hash)] +#[cfg_attr(feature = "serde", derive(serde::Serialize))] pub enum Token<'a> { Metadata { key: &'a str,