Skip to content

Use copied() instead of cloned() for u16 iterator#884

Open
enlorik wants to merge 1 commit into
microsoft:mainfrom
enlorik:fix/cloned-to-copied
Open

Use copied() instead of cloned() for u16 iterator#884
enlorik wants to merge 1 commit into
microsoft:mainfrom
enlorik:fix/cloned-to-copied

Conversation

@enlorik

@enlorik enlorik commented Jun 22, 2026

Copy link
Copy Markdown

push_utf16_lossy iterates over a &[u16] and calls .cloned(). Since u16 is Copy, .copied() is the idiomatic choice here — it states intent more precisely and is what Clippy's cloned_instead_of_copied lint recommends. No behaviour change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant