redundant-iter-cloned Disallow cloning iterator elements that are only borrowed afterward Cloning iterator elements is unnecessary when the following operation only observes them through readonly borrows. Instead, you SHOULD operate on the borrowed elements directly. - Category: performance - Level: warning - Fix: automatic - Scope: module Reported import { Iterator } from "destack:iter"; struct Label { values: ^int32[]; } function lengths(values: Iterator<&readonly Label>): Iterator { return values.cloned().map((value) => value.values.length); } Accepted import { Iterator } from "destack:iter"; struct Label { values: ^int32[]; } function lengths(values: Iterator<&readonly Label>): Iterator { return values.map((value) => value.values.length); } Prior art - Clippy ยท redundantitercloned language/linter/src/rules/performance/redundantitercloned.rs:20