-
Notifications
You must be signed in to change notification settings - Fork 67
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
2.3.0 breaks HashMap
serialization as Vec
of pairs with bincode
#570
Comments
stephaneyfx
added a commit
to stephaneyfx/serde_with
that referenced
this issue
Mar 10, 2023
Some serializers (e.g. bincode) require a length to serialize a sequence. This code does what `iterator_len_hint` does (called by `collect_seq` in `serde`). Resolves jonasbb#570
Hi, thanks for the bug report. Sorry for the inconvenience. I think that is a side effect of the changes done for #565. There are other issues with that, so it will need to be reverted. |
bors bot
added a commit
that referenced
this issue
Mar 10, 2023
572: Revert a breaking change to the Seq trait bound r=jonasbb a=jonasbb The code released in #566 broke multiple thing. It broke compatability with bincode #570 and #571. It broke this atribute combination: ```rust #[serde_as(as = "Seq<(_, Vec<_>)>")] BTreeMap<usize, Vec<usize>>, ``` ``` error[E0277]: the trait bound `serde_with::Seq<(serde_with::Same, std::vec::Vec<serde_with::Same>)>: serde_with::SerializeAs<_>` is not satisfied ``` bors r+ Co-authored-by: Jonas Bushart <jonas@bushart.org>
stephaneyfx
added a commit
to stephaneyfx/serde_with
that referenced
this issue
Mar 10, 2023
Some serializers (e.g. bincode) require a length to serialize a sequence. This test verifies that mapping a map to a sequence when serializing provides the length to the serializer. For jonasbb#570
No worries. Thank you for this useful crate! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
HashMap
serialization asVec
of pairs withbincode
that worked withserde_with
2.2.0 breaks with 2.3.0.Reproduction
Cargo.toml
:src/lib.rs
:Expected output
cargo run
passes with no output.Actual output
cargo run
fails with:The text was updated successfully, but these errors were encountered: