Skip to content
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

add manual_ok_or lint #6233

Merged
merged 2 commits into from
Nov 3, 2020
Merged

add manual_ok_or lint #6233

merged 2 commits into from
Nov 3, 2020

Conversation

tnielens
Copy link
Contributor

Implements partially #5923

changelog: add lint manual_ok_or

@rust-highfive
Copy link

r? @flip1995

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Oct 27, 2020
Copy link
Member

@flip1995 flip1995 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't you implement this lint in the methods module? You wouldn't need the whole method call extraction boilerplate there.

@tnielens
Copy link
Contributor Author

Couldn't you implement this lint in the methods module? You wouldn't need the whole method call extraction boilerplate there.

In a next iteration, I planned to implement the pattern matching case. See comment about this in the test file.

intOpt match {
  Some(v) => Ok(v),
  None => Err("error"),
}

This doesn't really fit in the methods module, is it?

@flip1995
Copy link
Member

Ah ok, I missed that. Then having this in a separate file is fine.

clippy_lints/src/manual_ok_or.rs Outdated Show resolved Hide resolved
@flip1995
Copy link
Member

flip1995 commented Nov 3, 2020

@bors r+

Thanks!

@bors
Copy link
Collaborator

bors commented Nov 3, 2020

📌 Commit d780f61 has been approved by flip1995

@bors
Copy link
Collaborator

bors commented Nov 3, 2020

⌛ Testing commit d780f61 with merge 225ce5f...

@bors
Copy link
Collaborator

bors commented Nov 3, 2020

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: flip1995
Pushing 225ce5f to master...

@bors bors merged commit 225ce5f into rust-lang:master Nov 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants