Skip to content

Update ocpp-codegen to prettyplease 0.3 / syn 3; hold heapless at 0.8 - #3

Merged
Joatin merged 1 commit into
mainfrom
deps/prettyplease-0.3-syn-3
Aug 5, 2026
Merged

Update ocpp-codegen to prettyplease 0.3 / syn 3; hold heapless at 0.8#3
Joatin merged 1 commit into
mainfrom
deps/prettyplease-0.3-syn-3

Conversation

@Joatin

@Joatin Joatin commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Resolves the failing CI on #2 by taking the two dev-time updates and deliberately declining the third.

What's here

  • prettyplease 0.3 / syn 3 (ocpp-codegen): taken. The generator isn't published, and prettyplease 0.3's output is byte-identical on every generated file — ./scripts/generate.sh produces no diff, so the drift check passes with no ocpp-types source changes.
  • heapless 0.9: declined for now. serde-json-core 0.6 (the latest) still depends on heapless 0.8, so taking 0.9 links two copies of heapless into any downstream binary using the serde feature. No heapless type crosses this crate's public API, so it's a size cost with nothing bought. The pin in crates/ocpp-types/Cargo.toml carries a comment saying when to revisit.
  • Compat fix, kept regardless: heapless 0.9 changes String::try_from's error from () to CapacityError — the actual cause of the red CI on Bump the cargo-dependencies group across 1 directory with 3 updates #2. IdTag and MessageId declare type 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.
  • Tests: both wrappers get a TryFrom<&str, Error = ()> bound assertion, so a future heapless bump can't silently change the public error type.

Verified locally

cargo test --workspace, plus ocpp-types under serde, alloc, and serde,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

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
@Joatin
Joatin merged commit 555edb2 into main Aug 5, 2026
2 checks passed
@Joatin
Joatin deleted the deps/prettyplease-0.3-syn-3 branch August 5, 2026 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant