Closed
Description
(let-else will be stable in about 6 weeks from now (Rust 1.65); we should probably not ship this assist before then)
It would be nice to have an assist to rewrite let
statements with a match
like the following, to their corresponding let-else
form:
let val = match opt {
Some(it) => it,
None => return,
};
->
let Some(val) = opt else { return };
Criteria for the assist should be:
let
statement whose initializer is amatch
expressionmatch
has 2 arms, the first extracts data, the second has a diverging expression