Guide: minor clarifications for the Pointers part
This commit is contained in:
parent
3a8f4ec32a
commit
c7182ba997
1 changed files with 3 additions and 3 deletions
|
@ -3463,7 +3463,7 @@ note: previous borrow ends here
|
|||
|
||||
This is a big error message. Let's dig into it for a moment. There are three
|
||||
parts: the error and two notes. The error says what we expected, we cannot have
|
||||
two pointers that point to the same memory.
|
||||
two mutable pointers that point to the same memory.
|
||||
|
||||
The two notes give some extra context. Rust's error messages often contain this
|
||||
kind of extra information when the error is complex. Rust is telling us two
|
||||
|
@ -3762,7 +3762,7 @@ value that must persist as long as any of several referrers, read on.
|
|||
|
||||
## Rc and Arc
|
||||
|
||||
Sometimes, you need a variable that is referenced from multiple places
|
||||
Sometimes you need a variable that is referenced from multiple places
|
||||
(immutably!), lasting as long as any of those places, and disappearing when it
|
||||
is no longer referenced. For instance, in a graph-like data structure, a node
|
||||
might be referenced from all of its neighbors. In this case, it is not possible
|
||||
|
@ -3858,7 +3858,7 @@ match x {
|
|||
```
|
||||
|
||||
If you're matching on an enum which has variants, you can use `..` to
|
||||
ignore the value in the variant:
|
||||
ignore the value and type in the variant:
|
||||
|
||||
```{rust}
|
||||
enum OptionalInt {
|
||||
|
|
Loading…
Reference in a new issue