mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-21 02:23:19 +00:00
a8834bc46a
checks for manual reverse iteration (`.rev().next()`) of a `DoubleEndedIterator`
16 lines
506 B
Text
16 lines
506 B
Text
error: manual backwards iteration
|
|
--> $DIR/manual_next_back.rs:34:20
|
|
|
|
|
LL | let _ = (0..10).rev().next().unwrap();
|
|
| ^^^^^^^^^^^^^ help: use: `.next_back()`
|
|
|
|
|
= note: `-D clippy::manual-next-back` implied by `-D warnings`
|
|
|
|
error: manual backwards iteration
|
|
--> $DIR/manual_next_back.rs:35:32
|
|
|
|
|
LL | let _ = "something".bytes().rev().next();
|
|
| ^^^^^^^^^^^^^ help: use: `.next_back()`
|
|
|
|
error: aborting due to 2 previous errors
|
|
|