logoalt Hacker News

bryanlarsenlast Friday at 11:34 PM1 replyview on HN

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.


Replies

kibwenyesterday at 1:44 PM

It 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.