Skip to content

Update to bincode v2 #720

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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Conversation

intendednull
Copy link

@intendednull intendednull commented Mar 31, 2025

  • derive bincode::{Encode, Decode} for Decimal
  • update tests
  • bincode v2 bumps msrv to 1.85

cherryman and others added 2 commits March 11, 2025 21:25
`bincode_serialization_serde_float` is failing when the
serde-arbitrary-precision feature is active, but passes when only
serde-with-arbitrary-precision is active instead.

cargo test --features serde-str,serde-float,serde-arbitrary-precision serde::test::bincode
@intendednull
Copy link
Author

intendednull commented Apr 5, 2025

One test does not pass when "serde-arbitrary-precision" is set. It does pass when "serde-with-arbitrary-precision" is set, and not "serde-arbitrary-precision". Something to do with the serde_json encoding I think, will keep looking.

test serde::test::bincode_serialization_serde_float ... FAILED

failures:

---- serde::test::bincode_serialization_serde_float stdout ----
[src/serde.rs:548:38] &self.to_string() = "0"

thread 'serde::test::bincode_serialization_serde_float' panicked at src/serde.rs:708:88:
called `Result::unwrap()` on an `Err` value: UnexpectedEnd { additional: 6 }

assert_eq!(value, decoded);
assert_eq!(8usize + raw.len(), encoded.len());
assert_eq!(1usize + raw.len(), encoded.len());
Copy link
Author

@intendednull intendednull Apr 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure this is correct. I checked the str serialization path is running, but I'm fuzzy with the internal representation. Not sure why it would be smaller tbh

@intendednull
Copy link
Author

intendednull commented Apr 6, 2025

I've kept all the serde tests using the serde traits. Maybe we should add tests using the bincode Encode/Decode traits as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants