2018-12-31 20:36:59 -06:00
|
|
|
use serde_derive::Serialize;
|
2018-03-20 16:04:12 -05:00
|
|
|
|
2018-06-03 00:19:39 -05:00
|
|
|
#[derive(Serialize)]
|
2018-03-20 16:04:12 -05:00
|
|
|
struct Foo {
|
2018-06-03 00:30:55 -05:00
|
|
|
#[serde(flatten, skip_serializing_if = "Option::is_none")]
|
2018-03-20 16:04:12 -05:00
|
|
|
other: Option<Other>,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Serialize)]
|
|
|
|
struct Other {
|
2018-06-03 00:30:55 -05:00
|
|
|
x: u32,
|
2018-03-20 16:04:12 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|