Skip to content

Commit e245afd

Browse files
committed
fix typo (lifetime)
1 parent e7e10b6 commit e245afd

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

ownership-system/lifetime.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ fn foo<'a>(x: &'a str) -> &'a str {
8686
}
8787
```
8888

89-
在这里,约束返回值的Lifetime必须大约或等于参数`x`的Lifetime。下面函数写法也是合法的:
89+
在这里,约束返回值的Lifetime必须大于或等于参数`x`的Lifetime。下面函数写法也是合法的:
9090

9191
```rust
9292
fn foo<'a>(x: &'a str) -> &'a str {
@@ -164,7 +164,7 @@ fn foo<'a>(x: &'a str, y: &'a str) -> &'a str {
164164
}
165165
```
166166

167-
因为返回值同事依赖输入参数`x``y`,所以
167+
因为返回值同时依赖输入参数`x``y`,所以
168168

169169
```
170170
Lifetime(返回值) ⊆ ( Lifetime(x) ∩ Lifetime(y) )
@@ -203,7 +203,7 @@ fn foo<'a, 'b>(x: &'a str, y: &'b str) -> &'a str {
203203
<anon>:6 }
204204
```
205205

206-
编译器说自己无法正确的推导返回值的Lifetime,读者可能会疑问,“我们不是已经指定返回值的Lifetime为`'a`了吗?"。
206+
编译器说自己无法正确地推导返回值的Lifetime,读者可能会疑问,“我们不是已经指定返回值的Lifetime为`'a`了吗?"。
207207

208208
这儿我们同样可以通过生命周期推导公式推导:
209209

0 commit comments

Comments
 (0)