-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doc: improve Option::map example #25920
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
@@ -411,7 +411,9 @@ impl<T> Option<T> { | |||
/// ``` | |||
/// let num_as_str: Option<String> = Some("10".to_string()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this even being made into a String?
It's not clear to me that this really "improves" anything. It just makes the example more complicated. |
It's also nice to do an BTW, feel free to improve this example. |
I agree the variable names are unfortunate. How about:
|
nice suggestion... done! |
@bors r+ rollup |
📌 Commit 8221715 has been approved by |
No description provided.