about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorJorge Aparicio <japaricious@gmail.com>2015-01-07 19:26:00 -0500
committerJorge Aparicio <japaricious@gmail.com>2015-01-07 19:26:36 -0500
commit7d72719efc25c6cdb8963c187e93df646ba65245 (patch)
tree470d75c976f3fea1873ac7f7720b8139e77d026a /src/libcore
parented4bebda965bfbd6845aba52e0a6d622cd4a8d07 (diff)
downloadrust-7d72719efc25c6cdb8963c187e93df646ba65245.tar.gz
rust-7d72719efc25c6cdb8963c187e93df646ba65245.zip
fix the `&mut _` patterns
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/iter.rs2
-rw-r--r--src/libcore/option.rs2
-rw-r--r--src/libcore/result.rs6
3 files changed, 5 insertions, 5 deletions
diff --git a/src/libcore/iter.rs b/src/libcore/iter.rs
index d30cfc405a1..87d61358ed3 100644
--- a/src/libcore/iter.rs
+++ b/src/libcore/iter.rs
@@ -2344,7 +2344,7 @@ impl<A, I, F> RandomAccessIterator for Inspect<A, I, F> where
 ///
 /// // This iterator will yield up to the last Fibonacci number before the max value of `u32`.
 /// // You can simply change `u32` to `u64` in this line if you want higher values than that.
-/// let mut fibonacci = Unfold::new((Some(0u32), Some(1u32)), |&(ref mut x2, ref mut x1)| {
+/// let mut fibonacci = Unfold::new((Some(0u32), Some(1u32)), |&mut (ref mut x2, ref mut x1)| {
 ///     // Attempt to get the next Fibonacci number
 ///     // `x1` will be `None` if previously overflowed.
 ///     let next = match (*x2, *x1) {
diff --git a/src/libcore/option.rs b/src/libcore/option.rs
index 272570a0d5b..108cbadcc17 100644
--- a/src/libcore/option.rs
+++ b/src/libcore/option.rs
@@ -533,7 +533,7 @@ impl<T> Option<T> {
     /// ```
     /// let mut x = Some(4u);
     /// match x.iter_mut().next() {
-    ///     Some(&ref mut v) => *v = 42u,
+    ///     Some(&mut ref mut v) => *v = 42u,
     ///     None => {},
     /// }
     /// assert_eq!(x, Some(42));
diff --git a/src/libcore/result.rs b/src/libcore/result.rs
index 95ae6ebfb68..7868ec67c8a 100644
--- a/src/libcore/result.rs
+++ b/src/libcore/result.rs
@@ -383,8 +383,8 @@ impl<T, E> Result<T, E> {
     /// ```
     /// fn mutate(r: &mut Result<int, int>) {
     ///     match r.as_mut() {
-    ///         Ok(&ref mut v) => *v = 42,
-    ///         Err(&ref mut e) => *e = 0,
+    ///         Ok(&mut ref mut v) => *v = 42,
+    ///         Err(&mut ref mut e) => *e = 0,
     ///     }
     /// }
     ///
@@ -529,7 +529,7 @@ impl<T, E> Result<T, E> {
     /// ```
     /// let mut x: Result<uint, &str> = Ok(7);
     /// match x.iter_mut().next() {
-    ///     Some(&ref mut x) => *x = 40,
+    ///     Some(&mut ref mut x) => *x = 40,
     ///     None => {},
     /// }
     /// assert_eq!(x, Ok(40));