arcstr icon indicating copy to clipboard operation
arcstr copied to clipboard

Add support for encoding/decoding with bincode.

Open gz opened this issue 3 years ago • 7 comments

This PR adds optional support for serialization of ArcStr with bincode (similar to how it already exists for serde).

This avoids external projects which use arcstr and bincode having to wrap the ArcStr type to implement bincode::Decode and bincode::Encode for it.

gz avatar Sep 27 '22 23:09 gz

I'm willing to add this once there's a public release of bincode 2.0.0, but not before. It may be a semver-breaking change for me to move from 2.0.0-rc.1 to 2.0.0, and I don't want to make a major version bump of arcstr because of this.

thomcc avatar Sep 27 '22 23:09 thomcc

Codecov Report

Base: 96.33% // Head: 95.56% // Decreases project coverage by -0.76% :warning:

Coverage data is based on head (ea2b03e) compared to base (f183959). Patch coverage: 0.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #45      +/-   ##
==========================================
- Coverage   96.33%   95.56%   -0.77%     
==========================================
  Files           7        8       +1     
  Lines         873      880       +7     
==========================================
  Hits          841      841              
- Misses         32       39       +7     
Impacted Files Coverage Δ
src/impl_bincode.rs 0.00% <0.00%> (ø)
src/lib.rs 50.00% <ø> (-50.00%) :arrow_down:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

codecov-commenter avatar Sep 27 '22 23:09 codecov-commenter

This should also be implemented for Substr, and needs tests. That said, I wouldn't blame you on waiting on this given my other comments.

thomcc avatar Sep 27 '22 23:09 thomcc

Sounds good to me, while we're waiting for v2, I will work on adding support for Substr + tests.

gz avatar Sep 27 '22 23:09 gz

I added tests and implement traits for Substr too.

gz avatar Oct 05 '22 18:10 gz

Update May 2024: Still blocked on v2.0 of bincode.

thomcc avatar May 07 '24 00:05 thomcc