oxidecomputer / oxidecomputer/hubris
`pub use counters::Count` in `ringbuf` can't actually be used correctly
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 3.6k
- Forks
- 239
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 23
Description
The Count derive macro attempts to implement the counters::Count trait, so it doesn't work unless the crate in which the macro is expanded has a counters dependency. The ringbuf crate reexports the derive macro, which gives the impression that you can use that without having a direct dependency on counters...but if you do this, your code won't compile. Users still need to add a counters dependency as well, so the re-export doesn't actually do anything useful.
We should probably get rid of it, as it's really just a footgun (but like, a...foot rubber band gun; you can use it to shoot yourself in the foot, but the consequences of shooting yourself in the foot with it are "kind of annoying" but ultimately harmless).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Inspect the ringbuf crate's re-export of the Count derive macro and the macro's implementation of the counters::Count trait. Confirm how expansion behaves without a direct counters dependency, then remove the misleading re-export if appropriate and verify that the affected crates still compile.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- embedded-iot
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100