RS.CLIPPY.ITER_SKIP_ZERO

Disallows `.skip(0)`

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_skip_zero. Copyright ©2025 The Rust Team. All rights reserved.

What it does

Checks for usage of .skip(0) on iterators.

Why is this bad?

This was likely intended to be .skip(1) to skip the first element, as .skip(0) does nothing. If not, the call should be removed.

Example

let v = vec![1, 2, 3];
let x = v.iter().skip(0).collect::<Vec<_>>();
let y = v.iter().collect::<Vec<_>>();
assert_eq!(x, y);