mirror of
https://github.com/rust-lang/book.git
synced 2026-11-30 21:21:18 -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
|
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
|
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
|
binding. When we say the first binding is *shadowed* by the second, it means
|
||||||
that the second binding's value is what you will see when you use the variable
|
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
|
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 on a value, but have the binding be immutable after those
|
||||||
transformations have been completed. For example:
|
transformations have been completed. For example:
|
||||||
|
|||||||
Reference in New Issue
Block a user