Open miguelraz opened 1 year ago
Shadowing let x and then let mut x bindings with no intermediate uses of x could be combined to a single statement.
let x
let mut x
x
No response
fn foo() -> i32 { let x = 6; let mut x = x; x += 1; x }
Could be written as:
fn foo() -> i32 { let mut x = 6; x += 1; x }
If this is greenlit for contribution, I would not mind spearheading the implementation as a first contribution to clippy.
clippy
What it does
Shadowing
let x
and thenlet mut x
bindings with no intermediate uses ofx
could be combined to a single statement.Advantage
Drawbacks
No response
Example
Could be written as: