prefer-length-over-count Prefer stored array length over counting an unchanged iterator Counting every value from an unchanged array iterator performs linear work to recover the array's stored length. Instead, you SHOULD read length from the array directly. - Category: performance - Level: warning - Fix: automatic - Scope: module Reported function length(values: int32[]): isize { return values.iterator().count(); } Accepted function length(values: int32[]): isize { return values.length; } Prior art - Clippy ยท itercount language/linter/src/rules/performance/preferlengthovercount.rs:8