mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-23 21:23:56 +00:00
Fix clippy tests that trigger for_loop_over_fallibles
lint
This commit is contained in:
parent
4013d367fe
commit
3fc903eb95
3 changed files with 3 additions and 1 deletions
|
@ -8,6 +8,7 @@
|
||||||
clippy::for_kv_map
|
clippy::for_kv_map
|
||||||
)]
|
)]
|
||||||
#[allow(clippy::linkedlist, clippy::unnecessary_mut_passed, clippy::similar_names)]
|
#[allow(clippy::linkedlist, clippy::unnecessary_mut_passed, clippy::similar_names)]
|
||||||
|
#[allow(for_loop_over_fallibles)]
|
||||||
fn main() {
|
fn main() {
|
||||||
let vec = vec![1, 2, 3, 4];
|
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
|
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() {}
|
LL | for _v in vec.iter().next() {}
|
||||||
| ^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#![warn(clippy::for_loops_over_fallibles)]
|
#![warn(clippy::for_loops_over_fallibles)]
|
||||||
#![allow(clippy::uninlined_format_args)]
|
#![allow(clippy::uninlined_format_args)]
|
||||||
|
#![allow(for_loop_over_fallibles)]
|
||||||
|
|
||||||
fn for_loops_over_fallibles() {
|
fn for_loops_over_fallibles() {
|
||||||
let option = Some(1);
|
let option = Some(1);
|
||||||
|
|
Loading…
Reference in a new issue