1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2024-11-26 01:30:22 +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:
primeagen-rustaceans 2023-05-23 17:24:01 +05:30 committed by GitHub
parent 33f81d0610
commit 47f6a5dacf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,7 +2,7 @@
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`.
* Read `&'a Point` as "a borrowed `Point` which is valid for at least the
lifetime `a`".