File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -12,8 +12,8 @@ Handful of functions that will help you work with `Optional` types. 100% inspire
1212### expect(_ desrcription: String) -> Wrapped
1313Unwraps an ` Optional ` , yielding the content of a .some. Or throws ` fatalError ` with given description
1414``` swift
15- let x: String ? = nil
16- x.expect (" the world is ending" )
15+ let x: String ? = nil
16+ x.expect (" the world is ending" )
1717```
1818
1919### unwrapOr(_ def: Wrapped) -> Wrapped
@@ -55,7 +55,7 @@ let r = x.mapOr(42) { (v: String) -> Int in
5555
5656### mapOrElse\< T> \(_ def: () -> T, _ f: (Wrapped) -> T) -> T {
5757Applies a function to the contained value (if any), or computes a default (if not).
58- ```switf
58+ ```swift
5959let x: String ? = nil
6060let r = x.mapOrElse ({
6161 3 * 3
You can’t perform that action at this time.
0 commit comments