Closed
Description
Similar to "introduce variable", an "introduce match" action would replace the x
under cursor here
fn maybe() -> Option<i32> { Some(42) }
fn foo() {
let x = maybe();
x<|>
}
with this:
match x {
_ => (),
}
Assuming knowledge of the type of x
, we could later on add special cases, e.g. for booleans (use if
) or enums with two variants (use if let
).
This is similar to #525 but maybe a bit more user-discoverable ;) Feel free to close this issue if you feel like #525 is a better approach.
Metadata
Metadata
Assignees
Labels
No labels