mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-22 21:44:44 +00:00
7ceb706e9d
Updates `Clone` docs for `Copy` comparison. Quite a few people (myself included) have come under the impression that the difference between `Copy` and `Clone` is that `Copy` is cheap and `Clone` is expensive, where the actual difference is that `Copy` constrains the type to bit-wise copying, and `Clone` allows for more expensive operations. The source of this misconception is in the `Clone` docs, where the following line is in the description: > Differs from `Copy` in that `Copy` is implicit and extremely inexpensive, while `Clone` is always explicit and may or may not be expensive. The `Clone` documentation page also comes up before the `Copy` page on google when searching for "the difference between `Clone` and `Copy`". This PR updates the documentation to clarify that "extremely inexpensive" means an "inexpensive bit-wise copy" to hopefully prevent future rust users from falling into this misunderstanding. |
||
---|---|---|
.. | ||
benches | ||
src | ||
tests | ||
Cargo.toml |