about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--library/core/src/option.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/library/core/src/option.rs b/library/core/src/option.rs
index 96b16b13256..ed7703befcf 100644
--- a/library/core/src/option.rs
+++ b/library/core/src/option.rs
@@ -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();
     ///