@@ -452,7 +452,7 @@ <h1 id='タプル構造体' class='section-header'><a href='#タプル構造体'
452452it allows you to create a new type, distinct from that of its contained value
453453and expressing its own semantic meaning: -->
454454
455- < p > タプル構造体が非常に便利な場合も < em > あります</ em > が、1要素で使う場合だけです。タプル構造体の中に入っている値と、それ自体のセマンティックな表現を明確に区別できるような新しい型を作成できることから 、私たちはこれを「newtype」パターンと呼んでいます。</ p >
455+ < p > ただし、 タプル構造体が非常に便利な場合も < em > あります</ em > 。要素が1つだけの場合です。要素の値と区別でき、独自の意味を表現できるような新しい型を作成できることから 、私たちはこれを「newtype」パターンと呼んでいます。</ p >
456456
457457< span class ='rusttest '> fn main() {
458458 struct Inches(i32);
@@ -473,13 +473,13 @@ <h1 id='タプル構造体' class='section-header'><a href='#タプル構造体'
473473destructuring `let`, just as with regular tuples. In this case, the
474474`let Inches(integer_length)` assigns `10` to `integer_length`. -->
475475
476- < p > 上記の通り、 < code > let</ code > を使って分解することで、標準のタプルと同じように内部の整数型を取り出すことができます 。
477- このケースでは < code > let Inches(integer_length)</ code > が < code > integer_length</ code > へ < code > 10</ code > を束縛します 。</ p >
476+ < p > 上記の通り、標準のタプルと同じように < code > let</ code > を使って分解することで内部の整数型を取り出すことができます 。
477+ このケースでは < code > let Inches(integer_length)</ code > が < code > integer_length</ code > に < code > 10</ code > を代入します 。</ p >
478478
479479< h1 id ='unit-like-構造体 ' class ='section-header '> < a href ='#unit-like-構造体 '> Unit-like 構造体</ a > </ h1 >
480480<!-- You can define a `struct` with no members at all: -->
481481
482- < p > あなたは全くメンバを持たない < code > struct</ code > を定義できます 。</ p >
482+ < p > 全くメンバを持たない < code > struct</ code > を定義することもできます 。</ p >
483483
484484< span class ='rusttest '> fn main() {
485485 struct Electron;
@@ -494,7 +494,7 @@ <h1 id='unit-like-構造体' class='section-header'><a href='#unit-like-構造
494494tuple, `()`, sometimes called ‘unit’. Like a tuple struct, it defines a
495495new type. -->
496496
497- < p > 空のタプルである < code > ()</ code > は時々 < code > unit </ code > と呼ばれ、それに似ていることからこのような構造体を < code > unit-like</ code > と呼んでいます。タプル構造体のように、これは新しい型を定義します 。</ p >
497+ < p > このような構造体は「unit-like」であると言われます。空のタプルであり「unit」とも呼ばれる < code > ()</ code > とよく似ているからです。タプル構造体と同様に、 unit-like 構造体も新しい型を定義します 。</ p >
498498
499499<!-- This is rarely useful on its own (although sometimes it can serve as a
500500marker type), but in combination with other features, it can become
@@ -503,7 +503,7 @@ <h1 id='unit-like-構造体' class='section-header'><a href='#unit-like-構造
503503any data you need to store in the structure, you can just create a
504504unit-like `struct`. -->
505505
506- < p > これは単体でもごくまれに役立ちます(もっとも、時々型をマーク代わりとして役立てる程度です)が、他の機能と組み合わせることにより便利になります 。例えば、ライブラリはあなたにイベントを処理できる特定の < a href ="traits.html "> トレイト</ a > が実装されたストラクチャの作成を要求するかもしれません。もしそのストラクチャの中に保存すべき値が何もなければ、あなたはダミーのデータを作成する必要はなく、ただunit -likeな < code > struct</ code > を作るだけで良いのです。</ p >
506+ < p > これは単体では滅多に役に立ちません(マーカ型として使える場合もあります)が、他の機能と組み合わせると便利な場合があります 。例えば、ライブラリがイベントを処理する特定の < a href ="traits.html "> トレイト</ a > を実装する構造体の作成を要求するかもしれません。もしその構造体の中に保存すべき値が何もなければ、単にunit -likeな < code > struct</ code > を作るだけで良いのです。</ p >
507507
508508 < script type ="text/javascript ">
509509 window . playgroundUrl = "https://play.rust-lang.org" ;
0 commit comments