-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
L-suggestionLint: Improving, adding or fixing lint suggestionsLint: Improving, adding or fixing lint suggestions
Description
Description
The op_ref
lint already does this:
warning: needlessly taken reference of left operand
--> crates/rust-analyzer/src/reload.rs:582:51
|
582 | if dummy_replace.iter().any(|replace| &**replace == name) {
| ----------^^^^^^^^
| |
| help: use the left value directly: `**replace`
|
= note: `#[warn(clippy::op_ref)]` on by default
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref
IMO its easier to understand if the span and the suggestion includes the borrows
so
warning: deref which would be done by auto-deref
--> crates/rust-analyzer/src/handlers.rs:981:41
|
981 | snap.analysis.rename(position, &*params.new_name)?.map_err(to_proto::rename_error)?;
| ^^^^^^^^^^^^^^^^ help: try this: `params.new_name`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref
could become
warning: deref which would be done by auto-deref
--> crates/rust-analyzer/src/handlers.rs:981:41
|
981 | snap.analysis.rename(position, &*params.new_name)?.map_err(to_proto::rename_error)?;
| ^^^^^^^^^^^^^^^^^ help: try this: `¶ms.new_name`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref
Version
clippy 0.1.64 (f2d9393 2022-07-02)
Additional Labels
No response
Metadata
Metadata
Assignees
Labels
L-suggestionLint: Improving, adding or fixing lint suggestionsLint: Improving, adding or fixing lint suggestions