mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-07-21 22:35:46 +00:00
Add test of flatten in enum
error: collection is never read
--> test_suite/tests/test_gen.rs:728:25
|
728 | #[derive(Serialize, Deserialize)]
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collection_is_never_read
= note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info)
This commit is contained in:
@@ -725,6 +725,19 @@ fn test_gen() {
|
|||||||
flat: T,
|
flat: T,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Serialize, Deserialize)]
|
||||||
|
#[serde(untagged)]
|
||||||
|
pub enum Inner<T> {
|
||||||
|
Builder {
|
||||||
|
s: T,
|
||||||
|
#[serde(flatten)]
|
||||||
|
o: T,
|
||||||
|
},
|
||||||
|
Default {
|
||||||
|
s: T,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
// https://github.com/serde-rs/serde/issues/1804
|
// https://github.com/serde-rs/serde/issues/1804
|
||||||
#[derive(Serialize, Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub enum Message {
|
pub enum Message {
|
||||||
|
|||||||
Reference in New Issue
Block a user