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
#[derive(sval::Value, serde::Serialize)] pub struct MyStruct; fn main() { println!("{}", sval_json::stream_to_string(Some(MyStruct)).unwrap()); println!("{}", serde_json::to_string(&Some(MyStruct)).unwrap()); }
prints:
"MyStruct" null
In sval_json, we print the name of the unit struct because we treat them the same as unit variants. In serde_json, unit structs are encoded as null.
sval_json
serde_json
null
sval_json attempts to be serde_json compatible in encoding, so this is worth calling out, but can't be changed at this point.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
prints:
In
sval_json
, we print the name of the unit struct because we treat them the same as unit variants. Inserde_json
, unit structs are encoded asnull
.sval_json
attempts to beserde_json
compatible in encoding, so this is worth calling out, but can't be changed at this point.The text was updated successfully, but these errors were encountered: