Closed VictorKoenders closed 1 year ago
Patch coverage: 84.61
% and project coverage change: +0.48
:tada:
Comparison is base (
ebc3b6b
) 53.89% compared to head (c9fd18d
) 54.37%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
@VictorKoenders hello, I use bincode in my project as below:
signed.write_all(&bincode::encode_to_vec(
&sig_struct,
config::standard()
.skip_fixed_array_length()
.with_fixed_int_encoding()
.with_big_endian(),
)?)?;
it works well for the version of bincode = "2.0.0-rc.2"
but when upgrade into rc.3 I found the skip_fixed_array_length
has been removed, so what should I do for now, How to remove the length when serializing?
@TommyLike currently there is no such option. Bincode 1 and 2 should work as you'd expect without the configuration. Is there a particular issue you're running into?
@TommyLike currently there is no such option. Bincode 1 and 2 should work as you'd expect without the configuration. Is there a particular issue you're running into?
No, I realized it works as I expected, thanks!
Closes #613
Turns out serde never encodes a fixed array length with 32 elements or less. If an array is 33 elements or more, it silently falls back to the
&[T]
implementation (which does encode the length). Our test cases were only tested with large arrays.Because the config flags
write_fixed_array_length
andskip_fixed_array_length
were based on a wrong assumption on how serde/bincode 1 worked, these flags have been removed. They may be re-added in the future.