Rust Panic Handling Example

# Introduction In this lab, we learn about the error handling mechanism `panic` in Rust. It is a simple mechanism that prints an error message, unwinds the stack, and usually exits the program. The lab provides an example where `panic` is explicitly called when the beverage is "lemonade". > **Note:** If the lab does not specify a file name, you can use any file name you want. For example, you can use `main.rs`, compile and run it with `rustc main.rs && ./main`.

|
60 : 00

Click the virtual machine below to start practicing