Beginner Rust
Q19 / 100

What is pattern matching in Rust?

Correct! Well done.

Incorrect.

The correct answer is B) The match expression that destructures and matches against patterns like enum variants, literals, tuples, and structs

B

Correct Answer

The match expression that destructures and matches against patterns like enum variants, literals, tuples, and structs

Explanation

match coin { Coin::Penny => 1, Coin::Nickel => 5, _ => 0 } is exhaustive — all cases must be handled.

Progress
19/100