From 4411d5fcc7cc0c3c3ae9de6e38b9a259417000c6 Mon Sep 17 00:00:00 2001 From: Gimgim <93856041+gimbles@users.noreply.github.com> Date: Sun, 25 Sep 2022 15:48:08 +0530 Subject: [PATCH] Update option.rs --- library/core/src/option.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/library/core/src/option.rs b/library/core/src/option.rs index 96b16b13256ce..ed7703befcfa3 100644 --- a/library/core/src/option.rs +++ b/library/core/src/option.rs @@ -842,6 +842,7 @@ impl Option { /// ``` /// let good_year_from_input = "1909"; /// let bad_year_from_input = "190blarg"; + /// // Result::ok() converts a Result to an Option /// let good_year = good_year_from_input.parse().ok().unwrap_or_default(); /// let bad_year = bad_year_from_input.parse().ok().unwrap_or_default(); ///