From eecb6e97cdfeebd3a355cf30b6cc38eaa17fcd7f Mon Sep 17 00:00:00 2001 From: trackers-lover <119586643+trackers-lover@users.noreply.github.com> Date: Sun, 28 Apr 2024 09:02:12 +0800 Subject: [PATCH] sync content (#157) * Sync the original contents:upgrade syn crate to version 2.0 * Sync content --- english/src/ch10-03-lifetime-syntax.md | 2 +- src/ch10-03-lifetime-syntax.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/english/src/ch10-03-lifetime-syntax.md b/english/src/ch10-03-lifetime-syntax.md index 1746ca1..4468bc9 100644 --- a/english/src/ch10-03-lifetime-syntax.md +++ b/english/src/ch10-03-lifetime-syntax.md @@ -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. diff --git a/src/ch10-03-lifetime-syntax.md b/src/ch10-03-lifetime-syntax.md index 9b995dc..0308d3f 100644 --- a/src/ch10-03-lifetime-syntax.md +++ b/src/ch10-03-lifetime-syntax.md @@ -80,7 +80,7 @@ Rust 编译器有一个 **借用检查器**(*borrow checker*),它比较作 这里 `x` 拥有生命周期 `'b`,比 `'a` 要大。这就意味着 `r` 可以引用 `x`:Rust 知道 `r` 中的引用在 `x` 有效的时候也总是有效的。 -现在我们已经在一个具体的例子中展示了引用的生命周期位于何处,并讨论了 Rust 如何分析生命周期来保证引用总是有效的,接下来让我们聊聊在函数的上下文中参数和返回值的泛型生命周期。 +现在我们已经在一个具体的例子中展示了什么是引用的生命周期,并讨论了 Rust 如何分析生命周期来保证引用总是有效的,接下来让我们聊聊在函数的上下文中参数和返回值的泛型生命周期。 ### 函数中的泛型生命周期