Skip to content

Commit

Permalink
Simplify sample code for {Option, Result}::iter_mut
Browse files Browse the repository at this point in the history
Fixes #28431
  • Loading branch information
aochagavia committed Sep 16, 2015
1 parent 1fe126a commit 804f024
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/libcore/option.rs
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ impl<T> Option<T> {
/// ```
/// let mut x = Some(4);
/// match x.iter_mut().next() {
/// Some(&mut ref mut v) => *v = 42,
/// Some(v) => *v = 42,
/// None => {},
/// }
/// assert_eq!(x, Some(42));
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ impl<T, E> Result<T, E> {
/// ```
/// let mut x: Result<u32, &str> = Ok(7);
/// match x.iter_mut().next() {
/// Some(&mut ref mut x) => *x = 40,
/// Some(v) => *v = 40,
/// None => {},
/// }
/// assert_eq!(x, Ok(40));
Expand Down

0 comments on commit 804f024

Please sign in to comment.