mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-04-20 23:16:56 +02:00
Update lifetimes.md (#660)
Normally developers are aware of the simpler language of implicit vs explicit. By replacing elided with implicit readability of the application might be improved.
This commit is contained in:
parent
33f81d0610
commit
47f6a5dacf
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
A borrowed value has a _lifetime_:
|
A borrowed value has a _lifetime_:
|
||||||
|
|
||||||
* The lifetime can be elided: `add(p1: &Point, p2: &Point) -> Point`.
|
* The lifetime can be implicit: `add(p1: &Point, p2: &Point) -> Point`.
|
||||||
* Lifetimes can also be explicit: `&'a Point`, `&'document str`.
|
* Lifetimes can also be explicit: `&'a Point`, `&'document str`.
|
||||||
* Read `&'a Point` as "a borrowed `Point` which is valid for at least the
|
* Read `&'a Point` as "a borrowed `Point` which is valid for at least the
|
||||||
lifetime `a`".
|
lifetime `a`".
|
||||||
|
Loading…
x
Reference in New Issue
Block a user