Skip to content

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

Merged
lhecker merged 2 commits into
microsoft:mainfrom
enlorik:fix/cloned-to-copied
Jul 22, 2026
Merged

Use copied() instead of cloned() for u16 iterator#884
lhecker merged 2 commits into
microsoft:mainfrom
enlorik:fix/cloned-to-copied

Conversation

@enlorik

@enlorik enlorik commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

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.

@lhecker
lhecker enabled auto-merge (squash) July 21, 2026 15:23
@lhecker
lhecker merged commit ed52eff into microsoft:main Jul 22, 2026
3 checks passed
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.

2 participants