File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -70,19 +70,18 @@ impl<A, F> Iterator for RepeatCall<F>
70
70
///
71
71
/// use itertools::unfold;
72
72
///
73
- /// let mut fibonacci = unfold((1_u32, 1_u32), |state| {
74
- /// let (ref mut x1, ref mut x2) = *state;
75
- ///
73
+ /// let (mut x1, mut x2) = (1u32, 1u32);
74
+ /// let mut fibonacci = unfold((), move |_| {
76
75
/// // Attempt to get the next Fibonacci number
77
- /// let next = x1.saturating_add(* x2);
76
+ /// let next = x1.saturating_add(x2);
78
77
///
79
78
/// // Shift left: ret <- x1 <- x2 <- next
80
- /// let ret = * x1;
81
- /// * x1 = * x2;
82
- /// * x2 = next;
79
+ /// let ret = x1;
80
+ /// x1 = x2;
81
+ /// x2 = next;
83
82
///
84
83
/// // If addition has saturated at the maximum, we are finished
85
- /// if ret == * x1 && ret > 1 {
84
+ /// if ret == x1 && ret > 1 {
86
85
/// return None;
87
86
/// }
88
87
///
You can’t perform that action at this time.
0 commit comments