Skip to content

Commit 439eeec

Browse files
committed
消し忘れた段落を削除
1 parent 4e3d9ea commit 439eeec

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

src/ch10-02-traits.md

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -190,27 +190,6 @@ know, people`.
190190

191191
このコードは、`1 new tweet: horse_ebooks: of course, as you probably already know, people`と出力します。
192192

193-
<!--
194-
Note that because we defined the `Summary` trait and the `NewsArticle` and
195-
`Tweet` types in the same *lib.rs* in Listing 10-13, they’re all in the same
196-
scope. Let’s say this *lib.rs* is for a crate we’ve called `aggregator` and
197-
someone else wants to use our crate’s functionality to implement the `Summary`
198-
trait on a struct defined within their library’s scope. They would need to
199-
bring the trait into their scope first. They would do so by specifying `use
200-
aggregator::Summary;`, which then would enable them to implement `Summary` for
201-
their type. The `Summary` trait would also need to be a public trait for
202-
another crate to implement it, which it is because we put the `pub` keyword
203-
before `trait` in Listing 10-12.
204-
-->
205-
206-
リスト10-13で`Summary`トレイトと`NewArticle``Tweet`型を同じ*lib.rs*に定義したので、
207-
全部同じスコープにあることに注目してください。この*lib.rs*`aggregator`と呼ばれるクレート専用にして、
208-
誰か他の人が私たちのクレートの機能を活用して自分のライブラリのスコープに定義された構造体に`Summary`トレイトを実装したいとしましょう。
209-
まず、トレイトをスコープに取り込む必要があるでしょう。`use aggregator::Summary;`と指定してそれを行えば、
210-
これにより、自分の型に`Summary`を実装することが可能になるでしょう。`Summary`トレイトは、
211-
他のクレートが実装するためには、公開トレイトである必要があり、ここでは、リスト10-12の`trait`の前に、
212-
`pub`キーワードを置いたのでそうなっています。
213-
214193
<!--
215194
Other crates that depend on the `aggregator` crate can also bring the `Summary`
216195
trait into scope to implement `Summary` on their own types. One restriction to

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy