-
Notifications
You must be signed in to change notification settings - Fork 32
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
Problem with serde enum untagged #4
Comments
Adding to dependencies fixed the issue { version = "0.2", default-features = false }. Not sure if this shouldn't be the default because it is very hard to find the issue and I'm sure I won't be the last person to report this. #[derive(Debug, Serialize, Deserialize)]
#[serde(untagged)]
enum Data {
Integer(u64),
Pair(String, String),
} is an example from serde documentation and it should serialize and deserialize properly when importing any library - https://serde.rs/enum-representations.html. |
@pjankiewicz, looks like this is a result of tracing-bunyan-formatter including the arbitrary-precision feature by default, which causes a known issue with serde tag: serde-rs/json#505 Alternate workaround is mentioned here: serde-rs/json#505 (comment) |
Thanks for opening this issue! It validates the many hours I spent banging my head against my desk attempting to debug some unit test failures 🙂. The following resolves this issue: [dependencies]
tracing-bunyan-formatter = { default-features = false, version = "0.2" } |
The |
I had the weirdest bug ever. I took me 3 hours to narrow down the source below is a minimal example of the error
./src/main.rs
Cargo.toml
When adding
tracing-bunyan-formatter = "0.1.7"
to dependenies main throws an error. Tested also with "0.2.0".EDIT: Just noticed this issue #3
The text was updated successfully, but these errors were encountered: