diff --git a/1.6/ja/book/functions.md b/1.6/ja/book/functions.md index 59125259..7cee1e08 100644 --- a/1.6/ja/book/functions.md +++ b/1.6/ja/book/functions.md @@ -175,7 +175,8 @@ x = y = 5 次の例はコンパイルエラーを起こします。 ```ignore -let x = (let y = 5); // expected identifier, found keyword `let` +# // let x = (let y = 5); // expected identifier, found keyword `let` +let x = (let y = 5); // 識別子を期待していましたが、キーワード `let` が見付かりました ``` @@ -194,7 +195,8 @@ let x = (let y = 5); // expected identifier, found keyword `let` ```rust let mut y = 5; -let x = (y = 6); // x has the value `()`, not `6` +# // let x = (y = 6); // x has the value `()`, not `6` +let x = (y = 6); // xは値 `()` を持っており、 `6` ではありません ``` @@ -238,7 +240,8 @@ Rustはそのためのキーワード`return`を持っています。 fn foo(x: i32) -> i32 { return x; - // we never run this code! +# // we never run this code! + // このコードは走りません! x + 1 } ``` diff --git a/1.6/ja/book/guessing-game.md b/1.6/ja/book/guessing-game.md index 50147480..9bca3b7e 100644 --- a/1.6/ja/book/guessing-game.md +++ b/1.6/ja/book/guessing-game.md @@ -218,7 +218,9 @@ let foo = bar; 後程パターンを使います。簡単なのでもう使えますね。 ```rust +# // let foo = 5; // immutable. let foo = 5; // イミュータブル +# // let mut bar = 5; // mutable let mut bar = 5; // ミュータブル ``` diff --git a/1.6/ja/book/primitive-types.md b/1.6/ja/book/primitive-types.md index e0215015..b4e70c6c 100644 --- a/1.6/ja/book/primitive-types.md +++ b/1.6/ja/book/primitive-types.md @@ -74,9 +74,10 @@ Rustにはいくつかのカテゴリの中にたくさんの種類の数値型 もし数値リテラルがその型を推論させるものを何も持たないのであれば、以下のとおりデフォルトになります。 ```rust -let x = 42; // x has type i32 - -let y = 1.0; // y has type f64 +# // let x = 42; // x has type i32 +let x = 42; // xはi32型を持つ +# // let y = 1.0; // y has type f64 +let y = 1.0; // yはf64型を持つ ``` @@ -239,8 +240,10 @@ println!("The second name is: {}", names[1]); ```rust let a = [0, 1, 2, 3, 4]; -let complete = &a[..]; // A slice containing all of the elements in a -let middle = &a[1..4]; // A slice of a: just the elements 1, 2, and 3 +# // let complete = &a[..]; // A slice containing all of the elements in a +let complete = &a[..]; // aに含まれる全ての要素を持つスライス +# // let middle = &a[1..4]; // A slice of a: just the elements 1, 2, and 3 +let middle = &a[1..4]; // 1、2、3のみを要素に持つaのスライス ``` @@ -351,8 +354,10 @@ println!("x is {}", x); コンマを付けることで要素1のタプルを丸括弧の中の値と混同しないように明示することができます。 ```rust -(0,); // single-element tuple -(0); // zero in parentheses +# // (0,); // single-element tuple + (0,); // 1要素のタプル +# // (0); // zero in parentheses + (0); // 丸括弧に囲まれたゼロ ``` diff --git a/1.6/ja/book/structs.md b/1.6/ja/book/structs.md index d18b9570..e4f104e7 100644 --- a/1.6/ja/book/structs.md +++ b/1.6/ja/book/structs.md @@ -92,8 +92,10 @@ fn main() { point.x = 5; +# // let point = point; // this new binding can’t change now let point = point; // この新しい束縛でここから変更できなくなります +# // point.y = 6; // this causes an error point.y = 6; // これはエラーになります } ```