Skip to content

Commit

Permalink
fix: wrap serde usage in a cfg_attr. (#295)
Browse files Browse the repository at this point in the history
rzvxa authored Feb 6, 2024
1 parent 9bf29e4 commit b16d1a7
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion full-moon/src/ast/mod.rs
Original file line number Diff line number Diff line change
@@ -2216,7 +2216,7 @@ pub struct AstError {
additional: Cow<'static, str>,

/// If set, this is the complete range of the error
#[serde(skip_serializing_if = "Option::is_none")]
#[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
range: Option<(Position, Position)>,
}

2 changes: 1 addition & 1 deletion full-moon/src/tokenizer/structs.rs
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@ macro_rules! symbol {
$(feature = "" $version),+
))]
)*
#[serde(rename = $string)]
#[cfg_attr(feature = "serde", serde(rename = $string))]
$name,
)+
}

0 comments on commit b16d1a7

Please sign in to comment.