@@ -66,7 +66,15 @@ let s = "foo\
6666assert_eq! (" foobar" , s );
6767```
6868
69- <!-- Rust has more than just `&str`s though. A `String`, is a heap-allocated string. -->
69+ <!-- Note that you normally cannot access a `str` directly, but only through a `&str` -->
70+ <!-- reference. This is because `str` is an unsized type which requires additional -->
71+ <!-- runtime information to be usable. For more information see the chapter on -->
72+ <!-- [unsized types][ut]. -->
73+ 通常、` str ` には直接アクセス出来ず、 ` &str ` 参照を通してのみアクセス出来ることに注意して下さい。
74+ これは ` str ` がサイズ不定型であり追加の実行時情報がないと利用出来ないからです。
75+ 詳しくは[ サイズ不定型] [ ut ] の章を読んで下さい。
76+
77+ <!-- Rust has more than only `&str`s though. A `String` is a heap-allocated string. -->
7078<!-- This string is growable, and is also guaranteed to be UTF-8. `String`s are -->
7179<!-- commonly created by converting from a string slice using the `to_string` -->
7280<!-- method. -->
@@ -123,7 +131,7 @@ TcpStream::connect(&*addr_string); // addr_string を &str に変換して渡す
123131<!-- ## Indexing -->
124132## インデクシング
125133
126- <!-- Because strings are valid UTF-8, strings do not support indexing: -->
134+ <!-- Because strings are valid UTF-8, they do not support indexing: -->
127135文字列が正しいUTF-8であるため、文字列はインデクシングをサポートしていません:
128136
129137``` rust,ignore
@@ -241,5 +249,6 @@ let hello_world = hello + &world;
241249これは、 ` &String ` が自動的に ` &str ` に型強制されるためです。
242250このフィーチャーは 「 [ ` Deref ` による型強制] [ dc ] 」と呼ばれています。
243251
252+ [ ut ] : unsized-types.html
244253[ dc ] : deref-coercions.html
245254[ connect ] : ../std/net/struct.TcpStream.html#method.connect
0 commit comments