Open
Description
What it does
Warns when a conflicting field name is present in both a struct and in a flattened field.
I open an issue in the serde repo serde-rs/serde#1820 and they suggested me to open it here
Categories (optional)
- Kind: Not sure
Avoid uncertainty about which field will be the one becoming serialized
Example
pub struct Base {
#[serde(flatten)]
pub flattened: Option<Flattened>,
pub name: String,
}
pub struct Flattened {
pub name: String,
}
Could issue a clippy warning suggesting to delete one of the fields named name
or rename.