Skip to content

Commit

Permalink
update(covariance-borrow-forever): 跳过前 2 节
Browse files Browse the repository at this point in the history
  • Loading branch information
zjp-CN committed Dec 15, 2023
1 parent 2f67521 commit 4f7c86a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/variance/covariance-borrow-forever.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ fn works(mut person: Person<'_>) {
}
```

我会简单略过这段代码不通过/通过的原因,如果你熟悉它们,则可以跳过以下两个小结(也无需关注上面的代码),而是从
[当 &'a Ty<'a> 牵绊你的时候](#当-a-tya-牵绊你的时候) 开始进入本文的正题。

# `&'a mut Ty<'a>` 是一种反模式

你绝不应该写 `&'a mut Ty<'a>`,因为它代表永远借用自己 —— 被借用的对象活 `'a` 那么长,而你指定了借用必须活 `'a`
Expand Down

0 comments on commit 4f7c86a

Please sign in to comment.