Skip to content

Commit c50303c

Browse files
authored
Rollup merge of #102259 - gimbles:patch-1, r=joshtriplett
Type-annotate and simplify documentation of Option::unwrap_or_default Part of #100054
2 parents b00b918 + 4411d5f commit c50303c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

library/core/src/option.rs

+1
Original file line numberDiff line numberDiff line change
@@ -842,6 +842,7 @@ impl<T> Option<T> {
842842
/// ```
843843
/// let good_year_from_input = "1909";
844844
/// let bad_year_from_input = "190blarg";
845+
/// // Result::ok() converts a Result<T> to an Option<T>
845846
/// let good_year = good_year_from_input.parse().ok().unwrap_or_default();
846847
/// let bad_year = bad_year_from_input.parse().ok().unwrap_or_default();
847848
///

0 commit comments

Comments
 (0)