Skip to content

Commit be37c00

Browse files
committed
fix a few 'variable does not need to be mutable' warnings
1 parent dfc5c0f commit be37c00

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/libcoretest/iter.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ fn test_iterator_chain() {
8282
let xs = [0, 1, 2, 3, 4, 5];
8383
let ys = [30, 40, 50, 60];
8484
let expected = [0, 1, 2, 3, 4, 5, 30, 40, 50, 60];
85-
let mut it = xs.iter().chain(ys.iter());
85+
let it = xs.iter().chain(ys.iter());
8686
let mut i = 0;
8787
for &x in it {
8888
assert_eq!(x, expected[i]);
@@ -91,7 +91,7 @@ fn test_iterator_chain() {
9191
assert_eq!(i, expected.len());
9292

9393
let ys = count(30, 10).take(4);
94-
let mut it = xs.iter().map(|&x| x).chain(ys);
94+
let it = xs.iter().map(|&x| x).chain(ys);
9595
let mut i = 0;
9696
for x in it {
9797
assert_eq!(x, expected[i]);
@@ -110,7 +110,7 @@ fn test_filter_map() {
110110
#[test]
111111
fn test_iterator_enumerate() {
112112
let xs = [0, 1, 2, 3, 4, 5];
113-
let mut it = xs.iter().enumerate();
113+
let it = xs.iter().enumerate();
114114
for (i, &x) in it {
115115
assert_eq!(i, x);
116116
}
@@ -152,7 +152,7 @@ fn test_iterator_peekable() {
152152
fn test_iterator_take_while() {
153153
let xs = [0, 1, 2, 3, 5, 13, 15, 16, 17, 19];
154154
let ys = [0, 1, 2, 3, 5, 13];
155-
let mut it = xs.iter().take_while(|&x| *x < 15);
155+
let it = xs.iter().take_while(|&x| *x < 15);
156156
let mut i = 0;
157157
for x in it {
158158
assert_eq!(*x, ys[i]);
@@ -165,7 +165,7 @@ fn test_iterator_take_while() {
165165
fn test_iterator_skip_while() {
166166
let xs = [0, 1, 2, 3, 5, 13, 15, 16, 17, 19];
167167
let ys = [15, 16, 17, 19];
168-
let mut it = xs.iter().skip_while(|&x| *x < 15);
168+
let it = xs.iter().skip_while(|&x| *x < 15);
169169
let mut i = 0;
170170
for x in it {
171171
assert_eq!(*x, ys[i]);
@@ -231,7 +231,7 @@ fn test_iterator_scan() {
231231
let xs = [0, 1, 2, 3, 4];
232232
let ys = [0f64, 1.0, 3.0, 6.0, 10.0];
233233

234-
let mut it = xs.iter().scan(0, add);
234+
let it = xs.iter().scan(0, add);
235235
let mut i = 0;
236236
for x in it {
237237
assert_eq!(x, ys[i]);
@@ -244,7 +244,7 @@ fn test_iterator_scan() {
244244
fn test_iterator_flat_map() {
245245
let xs = [0, 3, 6];
246246
let ys = [0, 1, 2, 3, 4, 5, 6, 7, 8];
247-
let mut it = xs.iter().flat_map(|&x| count(x, 1).take(3));
247+
let it = xs.iter().flat_map(|&x| count(x, 1).take(3));
248248
let mut i = 0;
249249
for x in it {
250250
assert_eq!(x, ys[i]);
@@ -279,7 +279,7 @@ fn test_unfoldr() {
279279
}
280280
}
281281

282-
let mut it = Unfold::new(0, count);
282+
let it = Unfold::new(0, count);
283283
let mut i = 0;
284284
for counted in it {
285285
assert_eq!(counted, i);

0 commit comments

Comments
 (0)