`|x: String| {x}.clone()` applies `clone()` to `{x}`, while `|x: String|
-> String {x}.clone()` applies `.clone()` to the closure because a
closure with an explicit return type requires a block as its body.
This extends the `precedence` lint to suggest using parentheses around
the closure definition in the second case, when `.clone()` would apply
to the whole closure.
changelog: [`precedence`]: warn about ambiguity when a closure is used
as a method call receiver
[Related
discussion](https://rust-lang.zulipchat.com/#narrow/channel/213817-t-lang/topic/Closure.20syntax.20ambiguity/with/504671477)
|
||
|---|---|---|
| .. | ||
| test_utils | ||
| ui | ||
| ui-cargo | ||
| ui-internal | ||
| ui-toml | ||
| workspace_test | ||
| check-fmt.rs | ||
| clippy.toml | ||
| compile-test.rs | ||
| config-consistency.rs | ||
| config-metadata.rs | ||
| dogfood.rs | ||
| integration.rs | ||
| lint_message_convention.rs | ||
| missing-test-files.rs | ||
| no-profile-in-cargo-toml.rs | ||
| symbols-used.rs | ||
| versioncheck.rs | ||
| workspace.rs | ||