mirror of
https://github.com/gnu4cn/rust-lang-zh_CN.git
synced 2025-03-14 03:10:44 +08:00
Updated
This commit is contained in:
parent
f94e429307
commit
c23c655d0c
@ -796,7 +796,7 @@ fn returns_summarizable(switch: bool) -> impl Summary {
|
||||
}
|
||||
```
|
||||
|
||||
由于编译器中实现 `impl Trait` 语法方式方面的限制,返回 `NewsArticle` 或 `Tweet` 便是不允许的。在第 17 章的 [运用允许不同类型值的特质对象](Ch17_Object_Oriented_Programming_Features_of_Rust.md#使用允许不同类型值的特质对象) 小节,咱们将涉及如何编写有着这种行为的函数。
|
||||
由于编译器中实现 `impl Trait` 语法方式方面的限制,返回 `NewsArticle` 或 `Tweet` 便是不允许的。在第 17 章的 [运用允许不同类型值的特质对象](Ch17_Object_Oriented_Programming_Features_of_Rust.md#使用允许不同类型值的特质对象) 小节,咱们就会降到如何编写有着这种行为的函数。
|
||||
|
||||
|
||||
### 运用特质边界来有条件地实现方法
|
||||
|
Loading…
Reference in New Issue
Block a user