You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code is as follows. Define struct, tagged enum wrapper, serialize it to bytes via serde_json, and then deserialize. Pretty usual deal. There's just one strange detail to it, see after the code snippet.
For the error to happen, 2 things must take place:
tracing-bunyan-formatter should be in the dependencies
one of the fields must be named timestamp
Cargo.toml:
[dependencies]
serde = { version = "1.0.125", features = ["derive"] }
serde_json = "1.0.64"tracing-bunyan-formatter = "0.2.0"
I couldn't figure out why on earth this tracing dependency breaks things, but for me it certainly does. I can avoid using this crate, but maybe this is a symptom of a bigger issue? It was pretty hard to debug and I'd appreciate if you have any suggestions and ideas on the possible reasons.
Thanks!
The text was updated successfully, but these errors were encountered:
Hi! First, thank for your amazing work. Serde is a gem!
rustup info
Affected versions:
serde: 1.0.118 - 1.0.125
serde_json:: 1.0.57 - 1.0.64
Minimal example
I've stumbled upon a pretty strange issue. I managed to minify the example to 3 dependencies https://github.com/folex/serde_bug_report and minimal lines of code in tests/test.rs.
What happened
I have a tagged enum. I serialize it, then deserialize, and get an error
The code is as follows. Define struct, tagged enum wrapper, serialize it to bytes via
serde_json
, and then deserialize. Pretty usual deal. There's just one strange detail to it, see after the code snippet.Stranger things
For the error to happen, 2 things must take place:
tracing-bunyan-formatter
should be in the dependenciestimestamp
Cargo.toml:
I couldn't figure out why on earth this tracing dependency breaks things, but for me it certainly does. I can avoid using this crate, but maybe this is a symptom of a bigger issue? It was pretty hard to debug and I'd appreciate if you have any suggestions and ideas on the possible reasons.
Thanks!
The text was updated successfully, but these errors were encountered: