Skip to content

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 }

let decoded: Decimal = decode_from_slice(&encoded[..], config::standard()).unwrap().0;
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

@paupino paupino marked this pull request as ready for review June 14, 2025 01:46
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