Fix generated code for deserializing untagged newtype variant

This commit is contained in:
David Tolnay
2018-05-19 17:14:20 -07:00
parent f09320b293
commit 16d1265e17
2 changed files with 12 additions and 4 deletions
+10
View File
@@ -643,6 +643,16 @@ fn test_gen() {
struct ImpliciltyBorrowedOption<'a> {
option: std::option::Option<&'a str>,
}
#[derive(Serialize, Deserialize)]
#[serde(untagged)]
enum UntaggedNewtypeVariantWith {
Newtype(
#[serde(serialize_with = "ser_x")]
#[serde(deserialize_with = "de_x")]
X,
),
}
}
//////////////////////////////////////////////////////////////////////////