book/listings/ch18-patterns-and-matching/listing-18-02/src/main.rs

14 lines
222 B
Rust

fn main() {
// ANCHOR: here
let mut stack = Vec::new();
stack.push(1);
stack.push(2);
stack.push(3);
while let Some(top) = stack.pop() {
println!("{top}");
}
// ANCHOR_END: here
}