Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix translation errors: 3. async/await 01_chapter.md #91

Merged
merged 1 commit into from
Dec 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src_zh-CN/03_async_await/01_chapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
{{#include ../../examples/03_01_async_await/src/lib.rs:static_future_with_borrow}}
```

通过移动参数到 `async` 块中,我们把它的生命周期扩展到了匹配调用 `foo` 函数返回的 `Future` 的生命周期。
通过移动参数到 `async` 块中,我们把它的生命周期扩展到了匹配调用 `good` 函数返回的 `Future` 的生命周期。

## `async move`

Expand All @@ -49,4 +49,4 @@
类似的,横跨 `.await` 持有一个非 future 感知的锁这种做法是很不好的,因为它能导致整个线程池 锁上:一个任务可能获得了锁,`.await` 然后让出到执行器,允许其他任务尝试获取所并导致死锁。 为了避免这种情况,使用 `futures::lock`里的 `Mutex` 类型比起 `std::sync` 里面的更好。


[第一章]: ../01_getting_started/04_async_await_primer.md
[第一章]: ../01_getting_started/04_async_await_primer.md
Loading