rust-plist
rust-plist copied to clipboard
#[serde(flatten)] serializes "Option<>" incorrectly
When using this crate, a setup such as this one generates an incorrect plist.
#[derive(Serialize)]
struct Annoying {
#[serde(flatten)]
second: Second,
}
#[derive(Serialize)]
struct Second {
test: Option<String>,
}
let test = Annoying {
second: Second {
test: Some("to".to_string())
}
};
println!("plist {}", plist_to_string(&test).unwrap())
Gives the incorrect output of:
<dict>
<key>test</key>
<dict>
<key>Some</key>
<string>to</string>
</dict>
</dict>
Correct output:
<dict>
<key>test</key>
<string>to</string>
</dict>
Thank you.
Seems to be a duplicate of https://github.com/ebarnard/rust-plist/pull/55#issuecomment-771113306