rust-embedded / rust-embedded/rust-sysfs-gpio

Make operations on pins take mutable reference

Open
#25 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
397
Forks
48
PR merge metrics
No merged PRs in 30d

Description

I believe it'd be more logical to take mutable reference to pins. I know that memory itself doesn't change, however, there are good reasons to require mutability anyway:

  • Accessing the pin from multiple threads probably isn't what people want to do by accident. (They still can do it on purpose.)
  • Requiring mutable reference allows people to write mocks and simulate the pins in tests.
  • It's more natural to use mutable references when you change something.
  • It clearly shows that some state is being mutated.

What do you think?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the public GPIO pin operation APIs in this repository and reviewing how their references are currently declared. Determine which operations are in scope, check the existing test coverage, and define done as consistent mutable-reference behavior with all affected tests and callers updated.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux, rust
Domain
embedded-iot, operating-systems
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.