How to avoid deeply nested switch statements?

For option types (but, unfortunately, not result) you can use do ? { … } blocks.