Skip to content

Commit 1317d15

Browse files
committed
Brush up translation for Associated Types (1.9)
1 parent f22e96c commit 1317d15

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

1.9/ja/book/associated-types.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
<!-- to write a `Graph` trait, you have two types to be generic over: the node type -->
88
<!-- and the edge type. So you might write a trait, `Graph<N, E>`, that looks like -->
99
<!-- this: -->
10-
関連型は、Rust型システムの強力な部分です。関連型は、「型族」という概念と関連が有り、
11-
言い換えると、複数の型をグループ化するものです。
10+
関連型は、Rust型システムの強力な部分です。
11+
関連型は、「型族」という概念と関連があり、言い換えると、複数の型をグループ化するものです。
1212
この説明はすこし抽象的なので、実際の例を見ていきましょう。
1313
例えば、 `Graph` トレイトを定義したいとしましょう、このときジェネリックになる2つの型: 頂点の型、辺の型 が存在します。
1414
そのため、以下のように `Graph<N, E>` と書きたくなるでしょう:
@@ -33,12 +33,12 @@ fn distance<N, E, G: Graph<N, E>>(graph: &G, start: &N, end: &N) -> u32 { ... }
3333

3434
<!-- Our distance calculation works regardless of our `Edge` type, so the `E` stuff in -->
3535
<!-- this signature is a distraction. -->
36-
この距離を計算する関数distanceは、辺の型に関わらず動作します、そのためシグネチャに含まれる `E` に関連する部分は邪魔となります
36+
この距離を計算する関数distanceは、辺の型に関わらず動作します、そのためシグネチャに含まれる `E` に関連する部分は邪魔になります
3737

3838
<!-- What we really want to say is that a certain `E`dge and `N`ode type come together -->
3939
<!-- to form each kind of `Graph`. We can do that with associated types: -->
4040
本当に表現したいことは、それぞれのグラフ( `Graph` )は辺( `E` )や頂点( `N` )で構成されているということです。
41-
それは、以下のように関連型を用いて表現することができます:
41+
それは、以下のように関連型を用いて表現できます:
4242

4343
```rust
4444
trait Graph {
@@ -59,7 +59,7 @@ fn distance<G: Graph>(graph: &G, start: &G::N, end: &G::N) -> u32 { ... }
5959
```
6060

6161
<!-- No need to deal with the `E`dge type here! -->
62-
もう `E` について扱う必要はありません!
62+
もう `E` について扱う必要はありません
6363

6464
<!-- Let’s go over all this in more detail. -->
6565
もっと詳しく見ていきましょう。
@@ -163,7 +163,7 @@ impl Graph for MyGraph {
163163

164164
<!-- There’s one more bit of syntax we should talk about: trait objects. If you -->
165165
<!-- try to create a trait object from a trait with an associated type, like this: -->
166-
すこし触れておきたい構文: トレイトオブジェクト があります
166+
すこし触れておきたい構文のひとつに、トレイトオブジェクトがあります
167167
もし、トレイトオブジェクトを以下のように関連型を持つトレイトから作成しようとした場合:
168168

169169
```rust,ignore

0 commit comments

Comments
 (0)