Just curious, is there a more idiomatic way to do something like this?
match action {
// ...
"Import" | "Execute" => {
// a bunch of code that should be run either way...
if action == "Import" {
// some stuff for Import
} else {
// some other stuff for Execute
}
}
// ...
}
and also is there better way to do something like this? (same thing but the "different code" part is before the shared code instead of after
match action {
// ...
}
if let "Import" | "Execute" = action {
// stuff to do after
}