Skip to content

fix a few 'variable does not need to be mutable' warnings #22509

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 22, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/libcoretest/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ fn test_iterator_chain() {
let xs = [0, 1, 2, 3, 4, 5];
let ys = [30, 40, 50, 60];
let expected = [0, 1, 2, 3, 4, 5, 30, 40, 50, 60];
let mut it = xs.iter().chain(ys.iter());
let it = xs.iter().chain(ys.iter());
let mut i = 0;
for &x in it {
assert_eq!(x, expected[i]);
Expand All @@ -91,7 +91,7 @@ fn test_iterator_chain() {
assert_eq!(i, expected.len());

let ys = count(30, 10).take(4);
let mut it = xs.iter().cloned().chain(ys);
let it = xs.iter().cloned().chain(ys);
let mut i = 0;
for x in it {
assert_eq!(x, expected[i]);
Expand All @@ -110,7 +110,7 @@ fn test_filter_map() {
#[test]
fn test_iterator_enumerate() {
let xs = [0, 1, 2, 3, 4, 5];
let mut it = xs.iter().enumerate();
let it = xs.iter().enumerate();
for (i, &x) in it {
assert_eq!(i, x);
}
Expand Down Expand Up @@ -152,7 +152,7 @@ fn test_iterator_peekable() {
fn test_iterator_take_while() {
let xs = [0, 1, 2, 3, 5, 13, 15, 16, 17, 19];
let ys = [0, 1, 2, 3, 5, 13];
let mut it = xs.iter().take_while(|&x| *x < 15);
let it = xs.iter().take_while(|&x| *x < 15);
let mut i = 0;
for x in it {
assert_eq!(*x, ys[i]);
Expand All @@ -165,7 +165,7 @@ fn test_iterator_take_while() {
fn test_iterator_skip_while() {
let xs = [0, 1, 2, 3, 5, 13, 15, 16, 17, 19];
let ys = [15, 16, 17, 19];
let mut it = xs.iter().skip_while(|&x| *x < 15);
let it = xs.iter().skip_while(|&x| *x < 15);
let mut i = 0;
for x in it {
assert_eq!(*x, ys[i]);
Expand Down Expand Up @@ -231,7 +231,7 @@ fn test_iterator_scan() {
let xs = [0, 1, 2, 3, 4];
let ys = [0f64, 1.0, 3.0, 6.0, 10.0];

let mut it = xs.iter().scan(0, add);
let it = xs.iter().scan(0, add);
let mut i = 0;
for x in it {
assert_eq!(x, ys[i]);
Expand All @@ -244,7 +244,7 @@ fn test_iterator_scan() {
fn test_iterator_flat_map() {
let xs = [0, 3, 6];
let ys = [0, 1, 2, 3, 4, 5, 6, 7, 8];
let mut it = xs.iter().flat_map(|&x| count(x, 1).take(3));
let it = xs.iter().flat_map(|&x| count(x, 1).take(3));
let mut i = 0;
for x in it {
assert_eq!(x, ys[i]);
Expand Down Expand Up @@ -279,7 +279,7 @@ fn test_unfoldr() {
}
}

let mut it = Unfold::new(0, count);
let it = Unfold::new(0, count);
let mut i = 0;
for counted in it {
assert_eq!(counted, i);
Expand Down