Move untagged borrow test case into codegen tests

This commit is contained in:
David Tolnay
2018-08-12 10:54:29 -07:00
parent 72b3438dfc
commit 0ca4db1616
2 changed files with 13 additions and 25 deletions
+13
View File
@@ -669,6 +669,19 @@ fn test_gen() {
#[serde(deserialize_with = "de_x")]
x: X,
}
#[derive(Deserialize)]
#[serde(untagged)]
enum UntaggedWithBorrow<'a> {
Single(#[serde(borrow)] RelObject<'a>),
Many(#[serde(borrow)] Vec<RelObject<'a>>),
}
#[derive(Deserialize)]
struct RelObject<'a> {
ty: &'a str,
id: String,
}
}
//////////////////////////////////////////////////////////////////////////