Make clippy tests compatible with new lint

This commit is contained in:
Devon Hollowood 2015-12-12 21:35:35 -08:00
parent aeb5a0e60c
commit 92fba6bd2c
2 changed files with 6 additions and 5 deletions

View File

@ -16,7 +16,8 @@ impl Unrelated {
#[deny(needless_range_loop, explicit_iter_loop, iter_next_loop, reverse_range_loop, explicit_counter_loop)]
#[deny(unused_collect)]
#[allow(linkedlist,shadow_unrelated,unnecessary_mut_passed, cyclomatic_complexity)]
#[allow(linkedlist,shadow_unrelated,unnecessary_mut_passed, cyclomatic_complexity,
used_underscore_binding)]
fn main() {
let mut vec = vec![1, 2, 3, 4];
let vec2 = vec![1, 2, 3, 4];

View File

@ -22,8 +22,8 @@ fn main() {
let y = NotARange;
y.step_by(0);
let _v1 = vec![1,2,3];
let _v2 = vec![4,5];
let _x = _v1.iter().zip(0.._v1.len()); //~ERROR It is more idiomatic to use _v1.iter().enumerate()
let _y = _v1.iter().zip(0.._v2.len()); // No error
let v1 = vec![1,2,3];
let v2 = vec![4,5];
let _x = v1.iter().zip(0..v1.len()); //~ERROR It is more idiomatic to use v1.iter().enumerate()
let _y = v1.iter().zip(0..v2.len()); // No error
}