Closed stephencelis closed 8 months ago
Swift allows us to omit .some and does the work to implicitly wrap optionals for us:
.some
let _: Int? = 42 // Equivalent to: let _: Int? = .some(42)
So why not do the same in case paths? Instead of forcing .some when going through an optional, we can go directly:
enum Foo { case bar(Bar?) } enum Bar { case baz(Int) } // Before: \Foo.Cases.bar.some.baz // After: \Foo.Cases.bar.baz
Swift allows us to omit
.some
and does the work to implicitly wrap optionals for us:So why not do the same in case paths? Instead of forcing
.some
when going through an optional, we can go directly: