From e8904f935ab45a033c61e2136674a080046fd733 Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Sun, 25 Feb 2018 15:46:17 -0500 Subject: [PATCH] Change the example string to something arbitrary The choice of string is arbitrary, so all references to a number in the string were removed. The string is now the standard "Hello world!". --- src/libcore/option.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/libcore/option.rs b/src/libcore/option.rs index 96b551d8704a..5c9fe8600768 100644 --- a/src/libcore/option.rs +++ b/src/libcore/option.rs @@ -233,11 +233,12 @@ impl Option { /// [`usize`]: ../../std/primitive.usize.html /// /// ``` - /// let num_as_str: Option = Some("12".to_string()); + /// let text: Option = Some("Hello, world!".to_string()); /// // First, cast `Option` to `Option<&String>` with `as_ref`, - /// // then consume *that* with `map`, leaving `num_as_str` on the stack. - /// let num_length: Option = num_as_str.as_ref().map(|n| n.len()); - /// println!("still can print num_as_str: {:?}", num_as_str); + /// // then consume *that* with `map`, leaving `text` on the stack. + /// let text_length: Option = text.as_ref().map(|s| s.len()); + /// println!("text length: {}", text_length); + /// println!("still can print text: {:?}", text); /// ``` #[inline] #[stable(feature = "rust1", since = "1.0.0")]