You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/error/option_unwrap/question_mark.md
+11-8Lines changed: 11 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,20 @@
1
-
# Unpacking options with ?
1
+
# Unpacking options with `?`
2
2
3
-
You can unpack Options by using `match` statements, but it's often easier to use the `?` operator. If `x` is an `Option`, then evaluating `x?` will return the underlying value if `x` is Some, otherwise it will terminate whatever function is being executed and return `None`.
3
+
You can unpack `Option`s by using `match` statements, but it's often easier to
4
+
use the `?` operator. If `x` is an `Option`, then evaluating `x?` will return
5
+
the underlying value if `x` is `Some`, otherwise it will terminate whatever
0 commit comments