Skip to content

Conversation

samueltardieu
Copy link
Member

@samueltardieu samueltardieu commented May 11, 2025

If an expression is not going to return from the current function of closure, it should not get linted.

This also allows return expression to be linted, in addition to the final expression. Those require blockification and proper indentation.

changelog: [return_and_then]: only lint returning expressions

Fixes #14781

If an expression is not going to return from the current function of
closure, it should not get linted.

This also allows `return` expression to be linted, in addition to the
final expression. Those require blockification and proper indentation.
@rustbot
Copy link
Collaborator

rustbot commented May 11, 2025

r? @llogiq

rustbot has assigned @llogiq.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label May 11, 2025
@llogiq
Copy link
Contributor

llogiq commented May 12, 2025

Thank you!

@llogiq llogiq added this pull request to the merge queue May 12, 2025
Merged via the queue into rust-lang:master with commit 459364b May 12, 2025
11 of 13 checks passed
@samueltardieu samueltardieu deleted the issue-14781 branch May 12, 2025 16:32
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.

return_and_then: suggests using ? operator on Option in function which returns Result

3 participants