We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 9cd4c44 + f1828f5 commit 9579046Copy full SHA for 9579046
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