Skip to content

Commit

Permalink
Merge pull request #48 from Newbandysol/patch-1
Browse files Browse the repository at this point in the history
item6-newtype.md的错误
  • Loading branch information
lispking authored Jul 23, 2024
2 parents 86e299a + d95845a commit b7f75b8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/chapter_1/item6-newtype.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ print_page(DoubleSided(true), ColorOutput(false));

另一个[常见]但更巧妙的需要 newtype 模式的场景,是 Rust 的孤儿规则。这个规则意味着,在一个包里,以下条件之一满足时,才能为某个类型实现特性:

• 包定义了该特性
• 包定义了该特性
• 包定义了该类型

我们来尝试为一个外部类型实现一个外部特性:
Expand Down

0 comments on commit b7f75b8

Please sign in to comment.