rust-lang / rust-lang/rust-clippy
Changing `bool` to `Result<(), ()>` in function return type leads to clippy warnings
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 13.5k
- Forks
- 2.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 32
Description
Summary
I often see functions returning a success/failure via a bool in Rust code bases. Changing that to Result<(), ()>, while IMO objectively better than bool, since the meaning of success/failure is clear, gets linted by clippy. This means that people are encouraged not to switch away from bool.
I do not have a suggestion on how to fix this problem.
Lint Name
result_unit_err
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
Review the result_unit_err lint and its current behavior first; the issue does not identify a source file or test. Done requires a maintainer-approved resolution for whether and how this lint should treat Result<(), ()> versus bool, plus coverage for that decision.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100