Fundamentals18 / 42
Up next

while let

fn main() {
    let mut stack = vec![1, 2, 3];
    while let Some(top) = stack.pop() {
        println!("{top}");
    }
}
What you're solving

loop while a pattern keeps matching