@@ -9,7 +9,7 @@ Rustは制限された形式での演算子オーバーロードを提供して
9
9
型同士の間の演算子をサポートするためのトレイトが存在し、それらを実装することで演算子をオーバーロードできます。
10
10
11
11
<!-- For example, the `+` operator can be overloaded with the `Add` trait: -->
12
- 例えば 、 ` + ` の演算子は ` Add ` トレイトを利用することでオーバーロードできます :
12
+ たとえば 、 ` + ` の演算子は ` Add ` トレイトでオーバーロードできます :
13
13
14
14
``` rust
15
15
use std :: ops :: Add ;
@@ -54,7 +54,7 @@ fn main() {
54
54
55
55
<!-- Implementing these traits follows a pattern. Let’s look at [`Add`][add] in more -->
56
56
<!-- detail: -->
57
- それらのトレイトの実装はパターンに従います 。
57
+ それらのトレイトの実装は、ある一つのパターンに従います 。
58
58
[ ` Add ` ] [ add ] トレイトを詳しく見ていきましょう:
59
59
60
60
``` rust
@@ -72,8 +72,8 @@ pub trait Add<RHS = Self> {
72
72
<!-- There’s three types in total involved here: the type you `impl Add` for, `RHS`, -->
73
73
<!-- which defaults to `Self`, and `Output`. For an expression `let z = x + y`, `x` -->
74
74
<!-- is the `Self` type, `y` is the RHS, and `z` is the `Self::Output` type. -->
75
- 関連する3つの型が存在します: ` impl Add ` を実装するもの、 デフォルトが ` Self ` の ` RHS ` 、 そして ` Output ` 。
76
- 例えば 、式 ` let z = x + y ` においては ` x ` は ` Self ` 型 ` y ` は RHS、 ` z ` は ` Self::Output ` 型となります。
75
+ 関連する3つの型が存在します: ` impl Add ` を実装するもの、 デフォルトが ` Self ` の ` RHS ` 、 そして ` Output ` です 。
76
+ たとえば 、式 ` let z = x + y ` においては ` x ` は ` Self ` 型 ` y ` は RHS、 ` z ` は ` Self::Output ` 型となります。
77
77
78
78
``` rust
79
79
# struct Point ;
@@ -102,7 +102,7 @@ let x: f64 = p + 2i32;
102
102
103
103
<!-- Now that we know how operator traits are defined, we can define our `HasArea` -->
104
104
<!-- trait and `Square` struct from the [traits chapter][traits] more generically: -->
105
- オペレータトレイトがどのように定義されているかについて学びましたので 、[ トレイトについての章] [ traits ] の ` HasArea ` トレイトと ` Square ` 構造体をさらに一般的に定義することができます :
105
+ オペレータトレイトがどのように定義されているかを学びましたので 、[ トレイトについての章] [ traits ] の ` HasArea ` トレイトと ` Square ` 構造体をさらに一般的に定義できます :
106
106
107
107
[ traits ] : traits.html
108
108
@@ -140,7 +140,7 @@ fn main() {
140
140
<!-- For `HasArea` and `Square`, we declare a type parameter `T` and replace -->
141
141
<!-- `f64` with it. The `impl` needs more involved modifications: -->
142
142
` HasArea ` と ` Square ` について、型パラメータ ` T ` を宣言し ` f64 ` で置換しました。
143
- ` impl ` はさらに関連するモディフィケーシを必要とします :
143
+ ` impl ` はさらに関連する修正を必要とします :
144
144
145
145
``` ignore
146
146
impl<T> HasArea<T> for Square<T>
0 commit comments