Skip to main content

One doc tagged with "while-let"

View all tags

The `if let` and `while let` Control Flow Constructs

We've seen how powerful the match expression is for pattern matching. However, sometimes a match can be a bit verbose, especially when you only care about one of the possible cases. For these situations, Rust provides a convenient shorthand: if let.