Make Peripherals::steal() zero cost
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Refactor
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- rust
- Domain
- embedded-iot
Research direction
Start in src/peripheral/mod.rs around line 180 and inspect how Peripherals::steal() constructs and returns the zero-sized Peripherals value. Confirm the implementation no longer performs the static mut write and remains safe under its existing contract; the completed change should make the function zero-cost.
Written by the indexing model from the issue text.
Description
Peripherals::steal() has a write to a static mut: https://github.com/rust-embedded/cortex-m/blob/6b013138b734b9bbeb24a345f75d2bcc1c69fa8d/src/peripheral/mod.rs#L180
I expected it to be zero-cost, just constructing and returning the Peripherals which is a noop since it is ZST. This was a bit surprising.
- Dominant language
- Rust
- Stars
- 1k
- Forks
- 201
- Avg merge
- 1h 8m
- Merged PRs (30d)
- 2
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
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.
More from rust-embedded/cortex-m
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
rust-embedded/cortex-m#651 · 5 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
rust-embedded/cortex-m#637 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
rust-embedded/cortex-m#511 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
rust-embedded/cortex-m#695 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
rust-embedded/cortex-m#694 · 1 comment ·
All issues in rust-embedded/cortex-m
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
rescript-lang/rescript#8765 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
farion1231/cc-switch#8072 ·
Maintainers usually reply within 1 day
-
Python 3.15 supportPossibly taken @amnesiaof claimed this today. OpenL: python L: python:uv
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
dependabot/dependabot-core#16524 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
[Bug]: Migration link in chromadb/config.py error message returns 404Possibly taken @Imad2702 claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 90/100
chroma-core/chroma#7879 ·
Maintainers usually reply within 1 day