mirror of
https://github.com/rust-lang-cn/book-cn.git
synced 2025-01-23 23:50:25 +08:00
Fix references that are now invalid with the rearranging
This commit is contained in:
parent
35bb02632c
commit
72ec43263b
@ -1,6 +1,5 @@
|
||||
# Understanding Ownership
|
||||
|
||||
Now that we’ve got some basic syntax under our belt, it’s time to take a look
|
||||
at Rust’s most unique feature: ownership. We’ll also talk about several related
|
||||
features: borrowing, slices, and lifetimes, as well as how Rust lays things out
|
||||
in memory.
|
||||
Now let's look at Rust’s most unique feature: ownership. We’ll also talk about
|
||||
several related features: borrowing, slices, and lifetimes, as well as how Rust
|
||||
lays things out in memory.
|
||||
|
@ -168,11 +168,6 @@ the `String` is currently using. The capacity is the total amount of memory the
|
||||
and capacity matters, but not in this context, so don’t worry about it too much
|
||||
if it doesn’t make sense, and just ignore the capacity.
|
||||
|
||||
> We’ve talked about two kinds of composite types: arrays and tuples. `String`
|
||||
> is a third type: a `struct`, which we will cover the details of in the next
|
||||
> chapter of the book. For now, thinking about `String` as a tuple is close
|
||||
> enough.
|
||||
|
||||
When we assign `s1` to `s2`, the `String` itself is copied. But not all kinds
|
||||
of copying are the same. Many people draw distinctions between ‘shallow
|
||||
copying’ and ‘deep copying’. We don’t use these terms in Rust. We instead say
|
||||
|
Loading…
Reference in New Issue
Block a user