mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-03-18 05:37:52 +02:00
Rephrase awkward sentence in rc.md (#906)
This commit is contained in:
parent
0c408f139c
commit
e199aee30d
@ -29,7 +29,7 @@ fn main() {
|
||||
<details>
|
||||
|
||||
* `Rc`'s count ensures that its contained value is valid for as long as there are references.
|
||||
* Like C++'s `std::shared_ptr`.
|
||||
* `Rc` in Rust is like `std::shared_ptr` in C++.
|
||||
* `Rc::clone` is cheap: it creates a pointer to the same allocation and increases the reference count. Does not make a deep clone and can generally be ignored when looking for performance issues in code.
|
||||
* `make_mut` actually clones the inner value if necessary ("clone-on-write") and returns a mutable reference.
|
||||
* Use `Rc::strong_count` to check the reference count.
|
||||
|
Loading…
x
Reference in New Issue
Block a user