Non-idiomatic
let mut iter = v.iter();
if let Some(e) = iter.nth(0) {
print!("\n first elem: {} has type: {}", e, type_is(&e));
}
Clippy message - generated by running clippy in Rust playground for code above
warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent
--> src/main.rs:39:22
|
39 | if let Some(e) = iter.nth(0) {
| ^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `iter.next()`
|
= note: `#[warn(clippy::iter_nth_zero)]` on by default
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero