serde/test_suite/tests/ui/conflict/flatten-skip-serializing-if.rs

15 lines
220 B
Rust
Raw Normal View History

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