Skip to content

Commit 0f87317

Browse files
authored
Rollup merge of rust-lang#102259 - gimbles:patch-1, r=joshtriplett
Type-annotate and simplify documentation of Option::unwrap_or_default Part of rust-lang#100054
2 parents 21caae6 + 8a73d40 commit 0f87317

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

core/src/option.rs

Lines changed: 1 addition & 0 deletions
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)