Closed
Description
The last paragraph of section 5 reads:
So, we've cleared up all of the confusion around bindings, with one exception: why does Rust let us declare a variable binding without an initial value if we must initialize the binding before we use it? And how does it know that we have or have not initialized the binding? For that, we need to learn our next concept: if.
Unless I managed to completely miss it, those questions are never answered. I assume there were meant to be examples along the lines of
let y: int;
if x == 5i { y = 3 } else { y = 8 }
println!("{}", y);
and
let y: int;
if x == 5i { y = 3 }
println!("{}", y);
Metadata
Metadata
Assignees
Labels
No labels