We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
In the following code, S can be deserialized from a JSON array of bytes but the untagged enum E cannot.
S
E
#[macro_use] extern crate serde_derive; extern crate serde; extern crate serde_json; extern crate serde_bytes; #[derive(Deserialize, Debug)] #[serde(untagged)] enum E { S(S), } #[derive(Deserialize, Debug)] struct S { #[serde(with = "serde_bytes")] bytes: Vec<u8>, } fn main() { let j = "{\"bytes\":[5,4,3,2]}"; println!("{:?}", serde_json::from_str::<S>(j).unwrap()); println!("{}", serde_json::from_str::<E>(j).unwrap_err()); }
S { bytes: [5, 4, 3, 2] } data did not match any variant of untagged enum E
The text was updated successfully, but these errors were encountered:
Fixed in 3c4961c.
Sorry, something went wrong.
No branches or pull requests
In the following code,
S
can be deserialized from a JSON array of bytes but the untagged enumE
cannot.The text was updated successfully, but these errors were encountered: