fix some typos

Signed-off-by: cui fliter <imcusg@gmail.com>
This commit is contained in:
cui fliter
2022-07-11 00:21:52 +08:00
parent 68ab163a65
commit 2eeb2124ef
18 changed files with 23 additions and 23 deletions

View File

@@ -214,7 +214,7 @@ impl<'a> Reader for BufReader<'a> {
// 'a is not used in the following methods
}
// can be writting as :
// can be writing as :
impl Reader for BufReader<'_> {
}

View File

@@ -59,11 +59,11 @@ fn main() {
```
## lifetime annotating
The **borrow checker uses explicit lifetime annotations** to determine how long a referrence should be valid.
The **borrow checker uses explicit lifetime annotations** to determine how long a reference should be valid.
But for us users, in most cases, there is no need to annotate the lifetime, because there are several elision rules, before learning these rules, we need to know how to annotate lifetime manually.
#### funtion
#### function
Ignoring elision rules, lifetimes in function signatures have a few contraints
- any reference must have an annotated lifetime

View File

@@ -1,5 +1,5 @@
# &'static and T: 'static
`'static` is a reserverd lifetime name, you might have encountered it serveral times:
`'static` is a reserved lifetime name, you might have encountered it serveral times:
```rust
// A reference with 'static lifetime:
let s: &'static str = "hello world";