mirror of
https://github.com/rust-lang/book.git
synced 2026-11-30 19:54:34 -06:00
@@ -155,8 +155,8 @@ depends on the tradeoffs you want to make in your situation.
|
||||
|
||||
As we saw in the guessing game tutorial, we can declare new bindings with the
|
||||
same name as a previous binding, and the new binding *shadows* the previous
|
||||
binding. We say that the first binding is *shadowed* by the second, which means
|
||||
that the second binding's value is what you will see when you use the variable
|
||||
binding. When we say the first binding is *shadowed* by the second, it means
|
||||
the second binding's value is what you will see when you use the variable
|
||||
after the second binding. This can be useful if you’d like to perform a few
|
||||
transformations on a value, but have the binding be immutable after those
|
||||
transformations have been completed. For example:
|
||||
|
||||
Reference in New Issue
Block a user