documentation update to demonstrate mutability#44467
Conversation
|
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @aturon (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
|
r? @frewsxcv |
frewsxcv
left a comment
There was a problem hiding this comment.
lgtm! will wait for travis before approving for merge. thanks!
| /// assert_eq!("hello", v); | ||
| /// { | ||
| /// let s = v.get_mut(0..2); | ||
| /// let s = s.map(|s| { |
There was a problem hiding this comment.
alternatively, something like this could maybe work here, but what you have is 🆒 too
if let Some(s) = v.get_mut(0..2) {
s.make_ascii_uppercase();
}|
@bors r+ rollup |
|
📌 Commit c430fa8 has been approved by |
documentation update to demonstrate mutability rust-lang#44467 - demonstrate correct implementation returns `Some` - demonstrate out of bounds returns `None` - demonstrate mutability
#44467
SomeNone