iter-cloned-collect Prefer direct collection copying over iterator collection Iterating a borrowed contiguous collection, copying every element, and collecting them rebuilds the same owned array indirectly. Instead, you SHOULD create the owned array directly from the collection. - Category: performance - Level: warning - Fix: automatic - Scope: module Reported struct Label { values: ^int32[]; } function copy(values: &readonly Label[]): Label[] { return values.iterator().cloned().toArray(); } Accepted struct Label { values: ^int32[]; } function copy(values: &readonly Label[]): Label[] { return values.clone(); } Prior art - Clippy ยท iterclonedcollect language/linter/src/rules/performance/iterclonedcollect.rs:8