Skip to content

Commit 8de1e38

Browse files
committed
Little Fix translation.
1 parent a68bba6 commit 8de1e38

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

1.6/ja/book/deref-coercions.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<!-- The standard library provides a special trait, [`Deref`][deref]. It’s normally -->
55
<!-- used to overload `*`, the dereference operator: -->
66
標準ライブラリは特別なトレイト [`Dref`][deref] を提供します。
7-
`Deref` は通常参照外し演算子 `*` をオーバーロードするために利用されます。
7+
`Deref` は通常、参照外し演算子 `*` をオーバーロードするために利用されます。
88

99
```rust
1010
use std::ops::Deref;
@@ -34,9 +34,9 @@ fn main() {
3434
<!-- type `U`, and it implements `Deref<Target=T>`, values of `&U` will -->
3535
<!-- automatically coerce to a `&T`. Here’s an example: -->
3636
このように、 `Deref` はカスタマイズしたポインタ型を定義するのに便利です。
37-
一方で、`Deref` に関連するルールがもう一つ有ります 「derefによる型強制」です。
37+
一方で、`Deref` に関連する機能がもう一つ有ります: 「derefによる型強制」です。
3838
これは、 `Deref<Target=T>` を実装している型 `U` があるときに、
39-
`&U` が自動的に `&T` に型強制されるというものです
39+
`&U` が自動的に `&T` に型強制されるというルールです
4040
例えば:
4141

4242
```rust
@@ -57,7 +57,7 @@ foo(&owned);
5757
<!-- Using an ampersand in front of a value takes a reference to it. So `owned` is a -->
5858
<!-- `String`, `&owned` is an `&String`, and since `impl Deref<Target=str> for -->
5959
<!-- String`, `&String` will deref to `&str`, which `foo()` takes. -->
60-
値の前にアンパサンド(&)をつけることによって値への参照を取得することができます
60+
値の前にアンパサンド(&)をつけることによってその値への参照を取得することができます
6161
故に `owned``String` に、 `&owned``&String` になります。
6262
そして、 `String``Deref<Target=str>` を実装しているために、
6363
`&String``foo()` が要求している `&str` に型強制されます。
@@ -94,7 +94,7 @@ foo(&counted);
9494
<!-- this as many times as possible until the types match. -->
9595
先ほどのコードとの変化は `String``Rc<T>` でラッピングした点ですが、
9696
依然 `Rc<String>``String` が必要なところに渡すことができます。
97-
`foo` のシグネチャは変化していませんが、どちらの方についても正しく動作します
97+
`foo` のシグネチャは変化していませんが、どちらの型についても正しく動作します
9898
この例は2つの変換を含んでいます: `Rc<String>``String` に変換され、次に `String``&str` に変換されます。
9999
Rustはこのような変換を型がマッチするまで必要なだけ繰り返します。
100100

@@ -154,4 +154,4 @@ f.foo();
154154
<!-- get it right. And since it’s inserting `*`s, that uses `Deref`. -->
155155
`&&&&&&&&&&&&&&&&Foo` 型の値は `Foo` で定義されているメソッドを呼び出すことができます。
156156
これは、コンパイラが自動的に必要なだけ * 演算子を補うことによります。
157-
また、 `*` が補われることによって `Deref` が利用されます
157+
そして `*` が補われることによって `Deref` が利用される事になります

0 commit comments

Comments
 (0)