if let
Combines a pattern match and an if statement, and allows for brief non-exhaustive matches to be performed.
if let Some(x) = option {
do_something(x);
}
This is equivalent to:
match option {
Some(x) => do_something(x),
_ => {},
}
These blocks can also have e...