Fix clippy tests that trigger `for_loop_over_fallibles` lint
This commit is contained in:
parent
4013d367fe
commit
3fc903eb95
|
@ -8,6 +8,7 @@
|
|||
clippy::for_kv_map
|
||||
)]
|
||||
#[allow(clippy::linkedlist, clippy::unnecessary_mut_passed, clippy::similar_names)]
|
||||
#[allow(for_loop_over_fallibles)]
|
||||
fn main() {
|
||||
let vec = vec![1, 2, 3, 4];
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error: you are iterating over `Iterator::next()` which is an Option; this will compile but is probably not what you want
|
||||
--> $DIR/for_loop_unfixable.rs:14:15
|
||||
--> $DIR/for_loop_unfixable.rs:15:15
|
||||
|
|
||||
LL | for _v in vec.iter().next() {}
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#![warn(clippy::for_loops_over_fallibles)]
|
||||
#![allow(clippy::uninlined_format_args)]
|
||||
#![allow(for_loop_over_fallibles)]
|
||||
|
||||
fn for_loops_over_fallibles() {
|
||||
let option = Some(1);
|
||||
|
|
Loading…
Reference in New Issue