RS.CLIPPY.ITER_NTH_ZERO

Replace `iter.nth(0)` with `iter.next()`

This checker is a Clippy lint created by The Rust Project Contributors. The documentation shown here is a copy of the original documentation for: iter_nth_zero. Copyright ©2025 The Rust Team. All rights reserved.

What it does

Checks for the use of iter.nth(0).

Why is this bad?

iter.next() is equivalent to iter.nth(0), as they both consume the next element, but is more readable.

Example

let x = s.iter().nth(0);

Use instead:

let x = s.iter().next();