Skip to main content

Copy

Ownership in Rust 1. Stop fearing .clone()

·7 mins
The Rust community treats .clone() like a code smell. Sometimes it is. But most of the time, the instinct to avoid it costs more in complexity than the clone costs in nanoseconds. We dissect what clone actually does for every common type, the real cost spectrum across six orders of magnitude, and why Clone and Copy are not the same conversation.