-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New lint: result-unit-err #6157
Conversation
r? @ebroto (rust_highfive has picked a reviewer for you, use r? to override) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some thoughts.
I'm a bit hesitant about making it warn-by-default, beause I'm sure we are going to hear opinions on this :) but I would say that since it's warning only on public functions, it's more than desirable to not use this pattern there.
47e8464
to
db82b21
Compare
Yeah, I was thinking about making it Otherwise r? |
db82b21
to
2703e7a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps I should add a check for no_std code where a Result<_, ()> is somewhat more likely to be acceptable
I think that's a good idea, but given that we lint only on ()
I think we can assume no_std
users can use another type.
I did not see a nit before (error messages shouldn't be capitalized), I've changed it myself. When CI passes I'll merge this, thank you!
2703e7a
to
74ae116
Compare
@bors r+ |
📌 Commit 74ae116 has been approved by |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
This fixes #1721.
.stderr
file)cargo test
passes locallycargo dev update_lints
cargo dev fmt
changelog: new lint: result-unit-err