Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
kibwen
3 days ago
|
parent
|
context
|
favorite
| on:
Rust's Block Pattern
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.
bryanlarsen
1 day ago
[–]
That'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()?;
reply
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: