mirror of
https://github.com/rust-lang-cn/book-cn.git
synced 2025-02-02 15:28:40 +08:00
Typo fix
This commit is contained in:
parent
4e5a45202f
commit
b286a7cdcb
@ -151,7 +151,7 @@ impl Summary for Tweet {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
一旦定义了 `summarize_author`,我们就可以对 `Tweet` 结构体的实例调用 `summarize` 了,而 `summary` 的默认实现会调用我们提供的 `summarize_author` 定义。因为实现了 `summarize_author`,`Summary` trait 就提供了 `summarize` 方法的功能,且无需编写更多的代码。
|
一旦定义了 `summarize_author`,我们就可以对 `Tweet` 结构体的实例调用 `summarize` 了,而 `summarize` 的默认实现会调用我们提供的 `summarize_author` 定义。因为实现了 `summarize_author`,`Summary` trait 就提供了 `summarize` 方法的功能,且无需编写更多的代码。
|
||||||
|
|
||||||
```rust,ignore
|
```rust,ignore
|
||||||
let tweet = Tweet {
|
let tweet = Tweet {
|
||||||
|
Loading…
Reference in New Issue
Block a user