Scope Flattening
Now that all ends of scope are explicit, we can remove any blocks that aren’t the target of a break 'label.
#![allow(unused)]
fn main() {
{
let x;
x = String::new();
}
// becomes
let x;
x = String::new();
}
Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
Now that all ends of scope are explicit, we can remove any blocks that aren’t the target of a break 'label.
#![allow(unused)]
fn main() {
{
let x;
x = String::new();
}
// becomes
let x;
x = String::new();
}