From 7d72719efc25c6cdb8963c187e93df646ba65245 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Wed, 7 Jan 2015 19:26:00 -0500 Subject: fix the `&mut _` patterns --- src/libcore/iter.rs | 2 +- src/libcore/option.rs | 2 +- src/libcore/result.rs | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/libcore') 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 RandomAccessIterator for Inspect 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 Option { /// ``` /// 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 Result { /// ``` /// fn mutate(r: &mut Result) { /// 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 Result { /// ``` /// let mut x: Result = 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)); -- cgit 1.4.1-3-g733a5