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
Parsing (1-element) tuple structs into their inner type fail.
#[derive(Deserialize, Serialize, PartialEq, Debug)] struct UserId(u32); #[derive(Deserialize, Serialize, PartialEq, Debug)] struct Query { user_id: UserId, } fn main() { let query = "user_id=1"; println!("{:?}", from_str::<Query>(query)); // Err(Error { err: "invalid type: string \"1\", expected tuple struct UserId" }) println!("{:?}", to_string(Query{user_id: UserId(1)})); // Ok("user_id=1") }
I hope it could do. FYI, serde_json can do it.
The text was updated successfully, but these errors were encountered:
I would accept a patch for that.
Sorry, something went wrong.
No branches or pull requests
Parsing (1-element) tuple structs into their inner type fail.
I hope it could do. FYI, serde_json can do it.
The text was updated successfully, but these errors were encountered: