Skip to content

Commit

Permalink
sync content (#157)
Browse files Browse the repository at this point in the history
* Sync the original contents:upgrade syn crate to version 2.0

* Sync content
  • Loading branch information
trackers-lover committed Apr 28, 2024
1 parent d6cdce4 commit eecb6e9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion english/src/ch10-03-lifetime-syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Here, `x` has the lifetime `'b`, which in this case is larger than `'a`. This
means `r` can reference `x` because Rust knows that the reference in `r` will
always be valid while `x` is valid.

Now that you know where the lifetimes of references are and how Rust analyzes
Now that you know what the lifetimes of references are and how Rust analyzes
lifetimes to ensure references will always be valid, let’s explore generic
lifetimes of parameters and return values in the context of functions.

Expand Down
2 changes: 1 addition & 1 deletion src/ch10-03-lifetime-syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Rust 编译器有一个 **借用检查器**(*borrow checker*),它比较作

这里 `x` 拥有生命周期 `'b`,比 `'a` 要大。这就意味着 `r` 可以引用 `x`:Rust 知道 `r` 中的引用在 `x` 有效的时候也总是有效的。

现在我们已经在一个具体的例子中展示了引用的生命周期位于何处,并讨论了 Rust 如何分析生命周期来保证引用总是有效的,接下来让我们聊聊在函数的上下文中参数和返回值的泛型生命周期。
现在我们已经在一个具体的例子中展示了什么是引用的生命周期,并讨论了 Rust 如何分析生命周期来保证引用总是有效的,接下来让我们聊聊在函数的上下文中参数和返回值的泛型生命周期。

### 函数中的泛型生命周期

Expand Down

0 comments on commit eecb6e9

Please sign in to comment.