Skip to content

Commit 97bee3e

Browse files
committed
Merge pull request #29 from KeenS/markdown-syntax-space
Markdown記法の前後に空白を空ける
2 parents 1f9edc1 + cd39bb2 commit 97bee3e

File tree

7 files changed

+202
-202
lines changed

7 files changed

+202
-202
lines changed

1.6/ja/book/SUMMARY.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
* [クロージャ](closures.md)
3232
* [共通の関数呼出構文](ufcs.md)
3333
* [クレートとモジュール](crates-and-modules.md)
34-
* [`const``static`](const-and-static.md)
34+
* [`const``static`](const-and-static.md)
3535
* [アトリビュート](attributes.md)
36-
* [`type`エイリアス](type-aliases.md)
36+
* [`type` エイリアス](type-aliases.md)
3737
* [型間のキャスト](casting-between-types.md)
3838
* [関連型](associated-types.md)
3939
* [サイズ不定型](unsized-types.md)

1.6/ja/book/conditional-compilation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Rustには `#[cfg]` という特別なアトリビュートがあり、
3939

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

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

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

8181
# cfg_attr
8282

1.6/ja/book/getting-started.md

Lines changed: 53 additions & 53 deletions
Large diffs are not rendered by default.

1.6/ja/book/glossary.md

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

6969

1.6/ja/book/guessing-game.md

Lines changed: 127 additions & 127 deletions
Large diffs are not rendered by default.

1.6/ja/book/primitive-types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ let y: bool = false;
2323
```
2424

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

2828
[if]: if.html
2929

1.6/ja/book/structs.md

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

99
```rust
1010
let origin_x = 0;
1111
let origin_y = 0;
1212
```
1313

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

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

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

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

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

4848
```rust
4949
struct Point {
@@ -61,7 +61,7 @@ fn main() {
6161
```
6262

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

6666
<!-- Rust does not support field mutability at the language level, so you cannot
6767
write something like this: -->
@@ -105,7 +105,7 @@ fn main() {
105105

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

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

144144
```rust
145145
struct Color(i32, i32, i32);
@@ -160,7 +160,7 @@ let origin = Point(0, 0, 0);
160160

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

165165
```rust
166166
struct Color {
@@ -178,7 +178,7 @@ struct Point {
178178

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

183183
> 訳注: 原文を元に噛み砕くと、「タプルはフィールドの並びによって区別され、構造体はフィールドの名前によって区別されます。これはタプルと構造体の最たる違いであり、構造体を持つことは名前を付けられたデータの集まりを持つことに等しいため、構造体における名前付けは重要です。」といった所でしょうか。
184184
@@ -200,13 +200,13 @@ println!("length is {} inches", integer_length);
200200
<!-- As you can see here, you can extract the inner integer type through a
201201
destructuring `let`, just as with regular tuples. In this case, the
202202
`let Inches(integer_length)` assigns `10` to `integer_length`. -->
203-
上記の通り、`let`を使って分解することで、標準のタプルと同じように内部の整数型を取り出すことができます。
204-
このケースでは`let Inches(integer_length)``integer_length``10`を束縛します。
203+
上記の通り、 `let` を使って分解することで、標準のタプルと同じように内部の整数型を取り出すことができます。
204+
このケースでは `let Inches(integer_length)``integer_length``10` を束縛します。
205205

206206
# Unit-like 構造体
207207

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

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

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

230230
[trait]: traits.html

0 commit comments

Comments
 (0)