Skip to content

Commit

Permalink
Rollup merge of #102259 - gimbles:patch-1, r=joshtriplett
Browse files Browse the repository at this point in the history
Type-annotate and simplify documentation of Option::unwrap_or_default

Part of #100054
  • Loading branch information
fee1-dead authored Sep 25, 2022
2 parents b00b918 + 4411d5f commit c50303c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions library/core/src/option.rs
Original file line number Diff line number Diff line change
Expand Up @@ -842,6 +842,7 @@ impl<T> Option<T> {
/// ```
/// let good_year_from_input = "1909";
/// let bad_year_from_input = "190blarg";
/// // Result::ok() converts a Result<T> to an Option<T>
/// let good_year = good_year_from_input.parse().ok().unwrap_or_default();
/// let bad_year = bad_year_from_input.parse().ok().unwrap_or_default();
///
Expand Down

0 comments on commit c50303c

Please sign in to comment.