Add serialization support for heapless v0.8 and v0.9#295
Open
mandrean wants to merge 1 commit intojamesmunns:mainfrom
Open
Add serialization support for heapless v0.8 and v0.9#295mandrean wants to merge 1 commit intojamesmunns:mainfrom
mandrean wants to merge 1 commit intojamesmunns:mainfrom
Conversation
✅ Deploy Preview for cute-starship-2d9c9b canceled.
|
3816033 to
8fb6847
Compare
Add HVecV0_8 and HVecV0_9 flavors, convenience functions (to_vec_v0_8, to_vec_v0_9, to_vec_cobs_v0_8, to_vec_cobs_v0_9), CRC convenience functions (to_vec_crc32_v0_8, to_vec_crc32_v0_9), and re-exports in lib.rs. This allows users to fully migrate off heapless 0.7 (and its unmaintained atomic-polyfill dependency, RUSTSEC-2023-0089) by using default-features = false with heapless-v0_8 or heapless-v0_9 feature flags. Refs: jamesmunns#223
8fb6847 to
edca451
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extends PR #269 (which added
MaxSizeimpls for heapless v0.8/v0.9) with full serialization support, so users can completely migrate off heapless 0.7 and its unmaintainedatomic-polyfilldependency (RUSTSEC-2023-0089).HVecV0_8andHVecV0_9serialization flavors mirroring the existingHVecto_vec_v0_8,to_vec_cobs_v0_8,to_vec_v0_9,to_vec_cobs_v0_9to_vec_crc32_v0_8,to_vec_crc32_v0_9lib.rsUsers can now fully drop heapless 0.7 with:
A note on semver compatibility
PR #269 explicitly left out serialization support, noting: "This doesn't touch
to_vecor similar methods; I don't see a way of editing those without breaking semver."That concern would apply if we were changing the existing
to_vecsignature or its return type. However, this PR takes a different approach: it adds new functions with versioned names (to_vec_v0_9,to_vec_cobs_v0_9, etc.) alongside the existing ones. No existing function signatures, types, or behaviors are modified. Adding new public items to a crate is a minor (non-breaking) change under semver.Closes #223
Test plan
cargo build -p postcard --no-default-features --features heapless-v0_8— builds cleancargo build -p postcard --no-default-features --features heapless-v0_9— builds cleancargo build -p postcard --features heapless-v0_8,heapless-v0_9— all heapless versions coexistcargo test -p postcard --no-default-features --features heapless-v0_9— 14 tests pass (new v0.9 tests + existing non-heapless tests)cargo test -p postcard --no-default-features --features heapless-v0_8— 10 tests pass (new v0.8 tests + existing non-heapless tests)