mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-04-29 22:17:55 +00:00
Move untagged borrow test case into codegen tests
This commit is contained in:
@@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user