We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents b00b918 + 4411d5f commit c50303cCopy full SHA for c50303c
library/core/src/option.rs
@@ -842,6 +842,7 @@ impl<T> Option<T> {
842
/// ```
843
/// let good_year_from_input = "1909";
844
/// let bad_year_from_input = "190blarg";
845
+ /// // Result::ok() converts a Result<T> to an Option<T>
846
/// let good_year = good_year_from_input.parse().ok().unwrap_or_default();
847
/// let bad_year = bad_year_from_input.parse().ok().unwrap_or_default();
848
///
0 commit comments