Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support flatten within struct variant #1206

Closed
dtolnay opened this issue Apr 2, 2018 · 1 comment
Closed

Support flatten within struct variant #1206

dtolnay opened this issue Apr 2, 2018 · 1 comment

Comments

@dtolnay
Copy link
Member

dtolnay commented Apr 2, 2018

#[derive(Serialize, Deserialize)]
enum Foo {
    A {
        #[serde(flatten)]
        fields: HashMap<String, String>,
    }
}
error: proc-macro derive panicked
 --> src/main.rs:6:21
  |
6 | #[derive(Serialize, Deserialize)]
  |                     ^^^^^^^^^^^
  |
  = help: message: #[serde(flatten)] cannot be used within enums
@dtolnay
Copy link
Member Author

dtolnay commented May 7, 2018

@jplatte @tomjakubowski ready to go in Serde 1.0.47!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant