fix typo in ch10-02-traits.md

删去多余句号
pull/865/head
Zhixia 2 days ago committed by GitHub
parent 3322fa2860
commit b3fac03478
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -189,7 +189,7 @@ fn some_function<T: Display + Clone, U: Clone + Debug>(t: &T, u: &U) -> i32 {
{{#rustdoc_include ../listings/ch10-generic-types-traits-and-lifetimes/no-listing-06-impl-trait-returns-one-type/src/lib.rs:here}}
```
这里尝试返回 `NewsArticle``SocialPost` 是不被允许的,原因在于编译器中 `impl Trait` 语法的实现限制。第十八章的 [“顾及不同类型值的 trait 对象”][using-trait-objects-that-allow-for-values-of-different-types] 部分会介绍如何编写这样一个函数。
这里尝试返回 `NewsArticle``SocialPost` 是不被允许的,原因在于编译器中 `impl Trait` 语法的实现限制。第十八章的 [“顾及不同类型值的 trait 对象”][using-trait-objects-that-allow-for-values-of-different-types] 部分会介绍如何编写这样一个函数。
### 使用 trait bound 有条件地实现方法

Loading…
Cancel
Save