Update ocpp-codegen to prettyplease 0.3 / syn 3; hold heapless at 0.8 - #3
Merged
Conversation
Dependabot proposed all three (#2). The two dev-time ones are safe to take: ocpp-codegen isn't published, and prettyplease 0.3's output is byte-identical on every generated file, so the drift check passes untouched. heapless 0.9 is deliberately left out. serde-json-core 0.6 -- the latest -- still depends on heapless 0.8, so taking 0.9 would compile *two* copies of heapless into any downstream binary that enables the `serde` feature. That's a real size cost for a crate whose selling point is embedded/no-alloc, and no heapless type crosses this crate's public API to justify it. The pin carries a comment saying when to revisit. heapless 0.9 does change `String::try_from`'s error from `()` to `CapacityError`, which is what broke the Dependabot branch: IdTag and MessageId both declare `type Error = ()` and forwarded that result directly. They now map the error away, so the wrapper's own error type stays `()` -- this crate's public API, not something that should track a dependency's internals -- and the eventual 0.9 bump becomes a one-liner. Both types get a test asserting the associated type via a `TryFrom<&str, Error = ()>` bound, so a future bump can't silently change it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NHWdX2XtxE3iJNo5XbLCwC
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.
Resolves the failing CI on #2 by taking the two dev-time updates and deliberately declining the third.
What's here
ocpp-codegen): taken. The generator isn't published, and prettyplease 0.3's output is byte-identical on every generated file —./scripts/generate.shproduces no diff, so the drift check passes with noocpp-typessource changes.serde-json-core0.6 (the latest) still depends on heapless 0.8, so taking 0.9 links two copies of heapless into any downstream binary using theserdefeature. No heapless type crosses this crate's public API, so it's a size cost with nothing bought. The pin incrates/ocpp-types/Cargo.tomlcarries a comment saying when to revisit.String::try_from's error from()toCapacityError— the actual cause of the red CI on Bump the cargo-dependencies group across 1 directory with 3 updates #2.IdTagandMessageIddeclaretype Error = ()and forwarded that result straight through. They now map the error away, so the wrapper's error type stays()(this crate's public API shouldn't track a dependency's internals) and the eventual 0.9 bump is a one-liner.TryFrom<&str, Error = ()>bound assertion, so a future heapless bump can't silently change the public error type.Verified locally
cargo test --workspace, plusocpp-typesunderserde,alloc, andserde,alloc;cargo build --target thumbv7em-none-eabihf --features serde,alloc; clippy clean (two pre-existing warnings only); regeneration produces zero drift.Closes #2.
🤖 Generated with Claude Code
https://claude.ai/code/session_01NHWdX2XtxE3iJNo5XbLCwC