Skip to content

Commit a719264

Browse files
committed
Merge pull request #58 from KeenS/block-code-comment
コードブロック中のコメントの訳の整理
2 parents 5e06df8 + c3d20f2 commit a719264

File tree

4 files changed

+22
-10
lines changed

4 files changed

+22
-10
lines changed

1.6/ja/book/functions.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,8 @@ x = y = 5
175175
次の例はコンパイルエラーを起こします。
176176

177177
```ignore
178-
let x = (let y = 5); // expected identifier, found keyword `let`
178+
# // let x = (let y = 5); // expected identifier, found keyword `let`
179+
let x = (let y = 5); // 識別子を期待していましたが、キーワード `let` が見付かりました
179180
```
180181

181182
<!--The compiler is telling us here that it was expecting to see the beginning of-->
@@ -194,7 +195,8 @@ let x = (let y = 5); // expected identifier, found keyword `let`
194195
```rust
195196
let mut y = 5;
196197

197-
let x = (y = 6); // x has the value `()`, not `6`
198+
# // let x = (y = 6); // x has the value `()`, not `6`
199+
let x = (y = 6); // xは値 `()` を持っており、 `6` ではありません
198200
```
199201

200202
<!--The second kind of statement in Rust is the *expression statement*. Its-->
@@ -238,7 +240,8 @@ Rustはそのためのキーワード `return` を持っています。
238240
fn foo(x: i32) -> i32 {
239241
return x;
240242

241-
// we never run this code!
243+
# // we never run this code!
244+
// このコードは走りません!
242245
x + 1
243246
}
244247
```

1.6/ja/book/guessing-game.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,9 @@ let foo = bar;
218218
後程パターンを使います。簡単なのでもう使えますね。
219219

220220
```rust
221+
# // let foo = 5; // immutable.
221222
let foo = 5; // イミュータブル
223+
# // let mut bar = 5; // mutable
222224
let mut bar = 5; // ミュータブル
223225
```
224226

1.6/ja/book/primitive-types.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,10 @@ Rustにはいくつかのカテゴリの中にたくさんの種類の数値型
7474
もし数値リテラルがその型を推論させるものを何も持たないのであれば、以下のとおりデフォルトになります。
7575

7676
```rust
77-
let x = 42; // x has type i32
78-
79-
let y = 1.0; // y has type f64
77+
# // let x = 42; // x has type i32
78+
let x = 42; // xはi32型を持つ
79+
# // let y = 1.0; // y has type f64
80+
let y = 1.0; // yはf64型を持つ
8081
```
8182

8283
<!-- Here’s a list of the different numeric types, with links to their documentation -->
@@ -239,8 +240,10 @@ println!("The second name is: {}", names[1]);
239240

240241
```rust
241242
let a = [0, 1, 2, 3, 4];
242-
let complete = &a[..]; // A slice containing all of the elements in a
243-
let middle = &a[1..4]; // A slice of a: just the elements 1, 2, and 3
243+
# // let complete = &a[..]; // A slice containing all of the elements in a
244+
let complete = &a[..]; // aに含まれる全ての要素を持つスライス
245+
# // let middle = &a[1..4]; // A slice of a: just the elements 1, 2, and 3
246+
let middle = &a[1..4]; // 1、2、3のみを要素に持つaのスライス
244247
```
245248

246249
<!-- Slices have type `&[T]`. We’ll talk about that `T` when we cover -->
@@ -351,8 +354,10 @@ println!("x is {}", x);
351354
コンマを付けることで要素1のタプルを丸括弧の中の値と混同しないように明示することができます。
352355

353356
```rust
354-
(0,); // single-element tuple
355-
(0); // zero in parentheses
357+
# // (0,); // single-element tuple
358+
(0,); // 1要素のタプル
359+
# // (0); // zero in parentheses
360+
(0); // 丸括弧に囲まれたゼロ
356361
```
357362

358363
<!-- ## Tuple Indexing -->

1.6/ja/book/structs.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,10 @@ fn main() {
9292
9393
point.x = 5;
9494
95+
# // let point = point; // this new binding can’t change now
9596
let point = point; // この新しい束縛でここから変更できなくなります
9697
98+
# // point.y = 6; // this causes an error
9799
point.y = 6; // これはエラーになります
98100
}
99101
```

0 commit comments

Comments
 (0)