Made arrays never encode their length#625
Conversation
858d6d3 to
7d66b2d
Compare
…his was based on incorrect assumptions on how serde and bincode 1 works
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## trunk #625 +/- ##
==========================================
+ Coverage 53.89% 54.37% +0.48%
==========================================
Files 51 51
Lines 4457 4454 -3
==========================================
+ Hits 2402 2422 +20
+ Misses 2055 2032 -23
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
|
@VictorKoenders hello, I use bincode in my project as below: it works well for the version of |
We remove the call to `skip_fixed_array_length`, which no longer exists, and which never apparently did anything: bincode-org/bincode#625
|
@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_lengthandskip_fixed_array_lengthwere based on a wrong assumption on how serde/bincode 1 worked, these flags have been removed. They may be re-added in the future.