I was trying to explain someone about mutability today when, instead they accidentally used shadowing.
let x = 1;
let x = x + 1;
I’ve looked around to find more details about shadowing and why the above may or may not be a good idea. So far I’ve come across a post in a different thread and learned that Clippy can warn about such use.
I was wondering, (short of clippy warnings) is shadowing over mutability is an idiomatic usage or is it essentially foot-shooting? More importantly, is there a doc that gives more info about shadowing?