4 ms·
Variable shadowing felt wrong for a while because it's considered verboten in so many other environments. I use it fairly liberally in rust now.
by bryanlarsen 11mo ago
Variable shadowing felt wrong for a while because it's considered verboten in so many other environments. I use it fairly liberally in rust now.
- kibwen 11mo agoIt helps that the specific pattern of redeclaring a variable just to change its mutability for the remainder of its scope is about the least objectionable use of shadowing possible.
- bryanlarsen 11mo agoThat's not the only place I use shadowing though. I use it much more liberally. For example I feel this is right: let x = x.parse()?;