Skip to content

コードブロック中のコメントの訳の整理 #58

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 14, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions 1.6/ja/book/functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` が見付かりました
```

<!--The compiler is telling us here that it was expecting to see the beginning of-->
Expand All @@ -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` ではありません
```

<!--The second kind of statement in Rust is the *expression statement*. Its-->
Expand Down Expand Up @@ -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
}
```
Expand Down
2 changes: 2 additions & 0 deletions 1.6/ja/book/guessing-game.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,9 @@ let foo = bar;
後程パターンを使います。簡単なのでもう使えますね。

```rust
# // let foo = 5; // immutable.
let foo = 5; // イミュータブル
# // let mut bar = 5; // mutable
let mut bar = 5; // ミュータブル
```

Expand Down
19 changes: 12 additions & 7 deletions 1.6/ja/book/primitive-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -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型を持つ
```

<!-- Here’s a list of the different numeric types, with links to their documentation -->
Expand Down Expand Up @@ -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のスライス
```

<!-- Slices have type `&[T]`. We’ll talk about that `T` when we cover -->
Expand Down Expand Up @@ -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); // 丸括弧に囲まれたゼロ
```

<!-- ## Tuple Indexing -->
Expand Down
2 changes: 2 additions & 0 deletions 1.6/ja/book/structs.md
Original file line number Diff line number Diff line change
Expand Up @@ -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; // これはエラーになります
}
```
Expand Down