Closed
Description
I just had an interesting bug where I made a spelling error for the rename
attribute. When I discovered it, I thought the proc macro could probably catch this.
What I did by accident was:
#[derive(Deserialize)]
struct SomeStruct {
#[serde(rename = ""value)] // This should have been `rename = "value"`
pub a: i32
}
The second "
went in front of the rename value, instead of behind. Apparently, the proc macro accepts this input and only takes ""
, ignoring the value
. If there is a space between it (like #[serde(rename = "" value)]
), it'll fail properly, telling about the unknown attribute value
.
Metadata
Metadata
Assignees
Labels
No labels