Skip to content

Commit 3e945a5

Browse files
authored
Merge pull request #148 from kdnakt/translate-array
Translate untranslated lines in array.md
2 parents 0795452 + 96c70f6 commit 3e945a5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/primitives/array.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,22 @@ fn main() {
6868
analyze_slice(&ys[1 .. 4]);
6969
7070
// Example of empty slice `&[]`:
71+
// 空のスライスの例:`&[]`
7172
let empty_array: [u32; 0] = [];
7273
assert_eq!(&empty_array, &[]);
7374
assert_eq!(&empty_array, &[][..]); // Same but more verbose
75+
// 同じ意味だがより冗長な書き方
7476
7577
// Arrays can be safely accessed using `.get`, which returns an
7678
// `Option`. This can be matched as shown below, or used with
7779
// `.expect()` if you would like the program to exit with a nice
7880
// message instead of happily continue.
81+
// 配列は、`Option`を返す`.get`で安全にアクセスできます。
82+
// `Option`は以下のようにマッチさせることもできますし、
83+
// 運よく処理を続ける代わりに、`.expect()`で素敵なメッセージとともに
84+
// プログラムを終了することもできます。
7985
for i in 0..xs.len() + 1 { // Oops, one element too far!
86+
// おっと、1要素余分!
8087
match xs.get(i) {
8188
Some(xval) => println!("{}: {}", i, xval),
8289
None => println!("Slow down! {} is too far!", i),

0 commit comments

Comments
 (0)