Skip to content

Markdown記法の前後に空白を空ける #29

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 6 commits into from
Feb 15, 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
4 changes: 2 additions & 2 deletions 1.6/ja/book/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
* [クロージャ](closures.md)
* [共通の関数呼出構文](ufcs.md)
* [クレートとモジュール](crates-and-modules.md)
* [`const``static`](const-and-static.md)
* [`const``static`](const-and-static.md)
* [アトリビュート](attributes.md)
* [`type`エイリアス](type-aliases.md)
* [`type` エイリアス](type-aliases.md)
* [型間のキャスト](casting-between-types.md)
* [関連型](associated-types.md)
* [サイズ不定型](unsized-types.md)
Expand Down
4 changes: 2 additions & 2 deletions 1.6/ja/book/conditional-compilation.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Rustには `#[cfg]` という特別なアトリビュートがあり、

<!-- As for how to enable or disable these switches, if you’re using Cargo, -->
<!-- they get set in the [`[features]` section][features] of your `Cargo.toml`: -->
このようなスイッチの有効・無効の切り替えはCargoを利用している場合`Cargo.toml`中の [`[features]` セクション][features] で設定できます。
このようなスイッチの有効・無効の切り替えはCargoを利用している場合 `Cargo.toml` 中の [`[features]` セクション][features] で設定できます。

[features]: http://doc.crates.io/manifest.html#the-features-section

Expand Down Expand Up @@ -76,7 +76,7 @@ mod foo {
<!-- and so, no `foo` module will exist. -->
もしこのコードを `cargo build --features "foo"` としてコンパイルを行うと、
`--cfg features="foo"` が `rustc` に渡され、出力には `mod foo` が含まれます。
もし標準的な `cargo build` でコンパイルを行った場合、`rustc` に追加のフラグは渡されず`foo` モジュールは存在しない事になります。
もし標準的な `cargo build` でコンパイルを行った場合、`rustc` に追加のフラグは渡されず `foo` モジュールは存在しない事になります。

# cfg_attr

Expand Down
106 changes: 53 additions & 53 deletions 1.6/ja/book/getting-started.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion 1.6/ja/book/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ A type without a statically known size or alignment. ([more info][link])
<!-- that expressions can have side-effects. For example, a function included in an -->
<!-- expression might perform actions other than simply returning a value. -->
コンピュータプログラミングに於いて、式は値、定数、変数、演算子、1つの値へと評価される関数の組み合わせです。
例えば、`2 + (3 * 4)`は値14を返す式です。式が副作用を持ちうることに意味はありません。
例えば、 `2 + (3 * 4)` は値14を返す式です。式が副作用を持ちうることに意味はありません。
例えば、ある式に含まれる関数がただ値を返す以外にも何か作用をするかもしれません。


Expand Down
254 changes: 127 additions & 127 deletions 1.6/ja/book/guessing-game.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion 1.6/ja/book/primitive-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ let y: bool = false;
```

<!-- A common use of booleans is in [`if` conditionals][if]. -->
ブーリアンの一般的な使い方は、 [`if`条件][if] の中で用いるものです。
ブーリアンの一般的な使い方は、 [`if` 条件][if] の中で用いるものです。

[if]: if.html

Expand Down
32 changes: 16 additions & 16 deletions 1.6/ja/book/structs.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
<!-- `struct`s are a way of creating more complex data types. For example, if we were
doing calculations involving coordinates in 2D space, we would need both an `x`
and a `y` value: -->
`struct`はより複雑なデータ型を作る方法の1つです。例えば、もし私たちが2次元空間の座標に関する計算を行っているとして、`x``y`、両方の値が必要になるでしょう。
`struct` はより複雑なデータ型を作る方法の1つです。例えば、もし私たちが2次元空間の座標に関する計算を行っているとして、 `x``y` 、両方の値が必要になるでしょう。

```rust
let origin_x = 0;
let origin_y = 0;
```

<!-- A `struct` lets us combine these two into a single, unified datatype: -->
`struct`でこれら2つを1つのデータ型にまとめることができます。
`struct` でこれら2つを1つのデータ型にまとめることができます。

```rust
struct Point {
Expand All @@ -30,20 +30,20 @@ fn main() {
<!-- There’s a lot going on here, so let’s break it down. We declare a `struct` with
the `struct` keyword, and then with a name. By convention, `struct`s begin with
a capital letter and are camel cased: `PointInSpace`, not `Point_In_Space`. -->
ここで多くの情報が出てきましたから、順番に見ていきましょう。まず、`struct`キーワードを使って構造体とその名前を宣言しています。慣習により、構造体は初めが大文字のキャメルケースで記述しています。`PointInSpace`であり、`Point_In_Space`ではありません。
ここで多くの情報が出てきましたから、順番に見ていきましょう。まず、 `struct` キーワードを使って構造体とその名前を宣言しています。慣習により、構造体は初めが大文字のキャメルケースで記述しています。 `PointInSpace` であり、 `Point_In_Space` ではありません。

<!-- We can create an instance of our `struct` via `let`, as usual, but we use a `key:
value` style syntax to set each field. The order doesn’t need to be the same as
in the original declaration. -->
いつものように、`let``struct`のインスタンスを作ることができますが、ここでは`key: value`スタイルの構文でそれぞれのフィールドに値をセットしています。順序は元の宣言と同じである必要はありません。
いつものように、 `let``struct` のインスタンスを作ることができますが、ここでは `key: value` スタイルの構文でそれぞれのフィールドに値をセットしています。順序は元の宣言と同じである必要はありません。

<!-- Finally, because fields have names, we can access the field through dot
notation: `origin.x`. -->
最後に、作成された構造体のフィールドは名前を持つため、`origin.x`というようにドット表記でアクセスできます。
最後に、作成された構造体のフィールドは名前を持つため、 `origin.x` というようにドット表記でアクセスできます。

<!-- The values in `struct`s are immutable by default, like other bindings in Rust.
Use `mut` to make them mutable -->
Rustの他の束縛のように、`struct`が持つ値はイミュータブルがデフォルトです。`mut`を使うと値をミュータブルにできます。
Rustの他の束縛のように、 `struct` が持つ値はイミュータブルがデフォルトです。 `mut` を使うと値をミュータブルにできます。

```rust
struct Point {
Expand All @@ -61,7 +61,7 @@ fn main() {
```

<!-- This will print `The point is at (5, 0)`. -->
これは`The point is at (5, 0)`と出力されます。
これは `The point is at (5, 0)` と出力されます。

<!-- Rust does not support field mutability at the language level, so you cannot
write something like this: -->
Expand Down Expand Up @@ -103,7 +103,7 @@ fn main() {

<!-- A `struct` can include `..` to indicate that you want to use a copy of some
other `struct` for some of the values. For example: -->
`struct`の初期化時には、値の一部を他の構造体からコピーしたいことを示す`..`を含めることができます。例えば、
`struct` の初期化時には、値の一部を他の構造体からコピーしたいことを示す `..` を含めることができます。例えば、

```rust
struct Point3d {
Expand Down Expand Up @@ -137,7 +137,7 @@ let point = Point3d { z: 1, x: 2, .. origin };
<!-- Rust has another data type that’s like a hybrid between a [tuple][tuple] and a
`struct`, called a ‘tuple struct’. Tuple structs have a name, but
their fields don’t:-->
Rustには「タプル構造体」と呼ばれる、[タプル][tuple]と`struct`のハイブリットのようなデータ型があります。タプル構造体自体には名前がありますが、そのフィールドには名前がありません。
Rustには「タプル構造体」と呼ばれる、[タプル][tuple]と `struct` のハイブリットのようなデータ型があります。タプル構造体自体には名前がありますが、そのフィールドには名前がありません。

```rust
struct Color(i32, i32, i32);
Expand All @@ -158,7 +158,7 @@ let origin = Point(0, 0, 0);

<!-- It is almost always better to use a `struct` than a tuple struct. We would write
`Color` and `Point` like this instead: -->
ほとんどの場合タプル構造体よりも`struct`を使ったほうが良いです。`Color``Point`はこのようにも書けます。
ほとんどの場合タプル構造体よりも `struct` を使ったほうが良いです。 `Color``Point` はこのようにも書けます。

```rust
struct Color {
Expand All @@ -176,7 +176,7 @@ struct Point {

<!-- Now, we have actual names, rather than positions. Good names are important,
and with a `struct`, we have actual names. -->
今、私たちはフィールドの位置ではなく実際のフィールドの名前を持っています。良い名前は重要で、`struct`を使うということは、実際に名前を持っているということです。
今、私たちはフィールドの位置ではなく実際のフィールドの名前を持っています。良い名前は重要で、 `struct` を使うということは、実際に名前を持っているということです。

> 訳注: 原文を元に噛み砕くと、「タプルはフィールドの並びによって区別され、構造体はフィールドの名前によって区別されます。これはタプルと構造体の最たる違いであり、構造体を持つことは名前を付けられたデータの集まりを持つことに等しいため、構造体における名前付けは重要です。」といった所でしょうか。

Expand All @@ -198,13 +198,13 @@ println!("length is {} inches", integer_length);
<!-- As you can see here, you can extract the inner integer type through a
destructuring `let`, just as with regular tuples. In this case, the
`let Inches(integer_length)` assigns `10` to `integer_length`. -->
上記の通り、`let`を使って分解することで、標準のタプルと同じように内部の整数型を取り出すことができます。
このケースでは`let Inches(integer_length)``integer_length``10`を束縛します。
上記の通り、 `let` を使って分解することで、標準のタプルと同じように内部の整数型を取り出すことができます。
このケースでは `let Inches(integer_length)``integer_length``10` を束縛します。

# Unit-like 構造体

<!-- You can define a `struct` with no members at all: -->
あなたは全くメンバを持たない`struct`を定義できます。
あなたは全くメンバを持たない `struct` を定義できます。

```rust
struct Electron;
Expand All @@ -215,14 +215,14 @@ let x = Electron;
<!-- Such a `struct` is called ‘unit-like’ because it resembles the empty
tuple, `()`, sometimes called ‘unit’. Like a tuple struct, it defines a
new type. -->
空のタプルである`()`は時々`unit`と呼ばれ、それに似ていることからこのような構造体を`unit-like`と呼んでいます。タプル構造体のように、これは新しい型を定義します。
空のタプルである `()` は時々 `unit` と呼ばれ、それに似ていることからこのような構造体を `unit-like` と呼んでいます。タプル構造体のように、これは新しい型を定義します。

<!-- This is rarely useful on its own (although sometimes it can serve as a
marker type), but in combination with other features, it can become
useful. For instance, a library may ask you to create a structure that
implements a certain [trait][trait] to handle events. If you don’t have
any data you need to store in the structure, you can just create a
unit-like `struct`. -->
これは単体でもごくまれに役立ちます(もっとも、時々型をマーク代わりとして役立てる程度です)が、他の機能と組み合わせることにより便利になります。例えば、ライブラリはあなたにイベントを処理できる特定の[トレイト][trait]が実装されたストラクチャの作成を要求するかもしれません。もしそのストラクチャの中に保存すべき値が何もなければ、あなたはダミーのデータを作成する必要はなく、ただunit-likeな`struct`を作るだけで良いのです。
これは単体でもごくまれに役立ちます(もっとも、時々型をマーク代わりとして役立てる程度です)が、他の機能と組み合わせることにより便利になります。例えば、ライブラリはあなたにイベントを処理できる特定の[トレイト][trait]が実装されたストラクチャの作成を要求するかもしれません。もしそのストラクチャの中に保存すべき値が何もなければ、あなたはダミーのデータを作成する必要はなく、ただunit-likeな `struct` を作るだけで良いのです。

[trait]: traits.html