Skip to content

Commit a8356ee

Browse files
authored
Merge branch 'master' into translate
2 parents 16c4f34 + 5c6165d commit a8356ee

File tree

28 files changed

+606
-196
lines changed

28 files changed

+606
-196
lines changed

TranslationTable.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@
169169
| string | 文字列
170170
| string interpolation | 文字列インターポーレーション
171171
| struct | 構造体
172-
| structure | ストラクチャ
172+
| structure | 構造体
173173
| sum type | 直和型
174174
| symbol | シンボル
175175
| syntactic sugar | 糖衣構文

docs/cargo.html

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -169,17 +169,31 @@ <h1 class="menu-title">Rust By Example 日本語版</h1>
169169

170170
<div id="content" class="content">
171171
<main>
172-
<h1><a class="header" href="#cargo" id="cargo">Cargo</a></h1>
173-
<p><code>cargo</code> is the official Rust package management tool. It has lots of really
174-
useful features to improve code quality and developer velocity! These include</p>
172+
<!--
173+
# Cargo
174+
-->
175+
<h1><a class="header" href="#cargo" id="cargo">Cargo</a></h1>
176+
<!--
177+
`cargo` is the official Rust package management tool. It has lots of really
178+
useful features to improve code quality and developer velocity! These include
179+
-->
180+
<p><code>cargo</code>はRustの公式パッケージ管理ツールです。とても便利な機能が多くあり、コードの品質や開発速度の向上に役立ちます。以下はその例です。</p>
181+
<!--
182+
- Dependency management and integration with [crates.io](https://crates.io) (the
183+
official Rust package registry)
184+
- Awareness of unit tests
185+
- Awareness of benchmarks
186+
-->
175187
<ul>
176-
<li>Dependency management and integration with <a href="https://crates.io">crates.io</a> (the
177-
official Rust package registry)</li>
178-
<li>Awareness of unit tests</li>
179-
<li>Awareness of benchmarks</li>
188+
<li>依存関係の管理と<a href="https://crates.io">crates.io</a>(Rustの公式パッケージレジストリ)とのインテグレーション</li>
189+
<li>ユニットテスト</li>
190+
<li>ベンチマーク</li>
180191
</ul>
181-
<p>This chapter will go through some quick basics, but you can find the
182-
comprehensive docs in <a href="https://doc.rust-lang.org/cargo/">The Cargo Book</a>.</p>
192+
<!--
193+
This chapter will go through some quick basics, but you can find the
194+
comprehensive docs in [The Cargo Book](https://doc.rust-lang.org/cargo/).
195+
-->
196+
<p>この章では、簡単な基本機能を説明します。包括的なドキュメントは<a href="https://doc.rust-lang.org/cargo/">The Cargo Book</a>を参照してください。</p>
183197

184198
</main>
185199

docs/cargo/build_scripts.html

Lines changed: 45 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -169,31 +169,58 @@ <h1 class="menu-title">Rust By Example 日本語版</h1>
169169

170170
<div id="content" class="content">
171171
<main>
172-
<h1><a class="header" href="#build-scripts" id="build-scripts">Build Scripts</a></h1>
173-
<p>Sometimes a normal build from <code>cargo</code> is not enough. Perhaps your crate needs
174-
some pre-requisites before <code>cargo</code> will successfully compile, things like code
172+
<!--
173+
# Build Scripts
174+
-->
175+
<h1><a class="header" href="#ビルドスクリプト" id="ビルドスクリプト">ビルドスクリプト</a></h1>
176+
<!--
177+
Sometimes a normal build from `cargo` is not enough. Perhaps your crate needs
178+
some pre-requisites before `cargo` will successfully compile, things like code
175179
generation, or some native code that needs to be compiled. To solve this problem
176-
we have build scripts that Cargo can run.</p>
177-
<p>To add a build script to your package it can either be specified in the
178-
<code>Cargo.toml</code> as follows:</p>
180+
we have build scripts that Cargo can run.
181+
-->
182+
<p><code>cargo</code>による通常のビルドでは十分でないことが時々あります。コード生成や、コンパイルが必要なネイティブコードなど、<code>cargo</code>がクレートをうまくコンパイルするにはなんらかの前提条件が必要かもしれません。この問題を解決するため、Cargoが実行できるビルドスクリプトがあります。</p>
183+
<!--
184+
To add a build script to your package it can either be specified in the
185+
`Cargo.toml` as follows:
186+
-->
187+
<p>ビルドスクリプトをパッケージに追加するには、以下のように<code>Cargo.toml</code>の中で指定できます。</p>
179188
<pre><code class="language-toml">[package]
180189
...
181190
build = &quot;build.rs&quot;
182191
</code></pre>
183-
<p>Otherwise Cargo will look for a <code>build.rs</code> file in the project directory by
184-
default.</p>
185-
<h2><a class="header" href="#how-to-use-a-build-script" id="how-to-use-a-build-script">How to use a build script</a></h2>
186-
<p>The build script is simply another Rust file that will be compiled and invoked
192+
<!--
193+
Otherwise Cargo will look for a `build.rs` file in the project directory by
194+
default.
195+
-->
196+
<p>それ以外の場合、Cargoはデフォルトでプロジェクトディレクトリから<code>build.rs</code>を探します。</p>
197+
<!--
198+
## How to use a build script
199+
-->
200+
<h2><a class="header" href="#ビルドスクリプトの使い方" id="ビルドスクリプトの使い方">ビルドスクリプトの使い方</a></h2>
201+
<!--
202+
The build script is simply another Rust file that will be compiled and invoked
187203
prior to compiling anything else in the package. Hence it can be used to fulfill
188-
pre-requisites of your crate.</p>
189-
<p>Cargo provides the script with inputs via environment variables <a href="https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-build-scripts">specified
190-
here</a> that can be used.</p>
191-
<p>The script provides output via stdout. All lines printed are written to
192-
<code>target/debug/build/&lt;pkg&gt;/output</code>. Further, lines prefixed with <code>cargo:</code> will be
204+
pre-requisites of your crate.
205+
-->
206+
<p>ビルドスクリプトは単にRustのファイルの1つで、パッケージ内の他のファイルをコンパイルする前にコンパイルされて起動されます。そのため、クレートの前提条件を満たすために使用できます。</p>
207+
<!--
208+
Cargo provides the script with inputs via environment variables [specified
209+
here] that can be used.
210+
-->
211+
<p>Cargoは、<a href="https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-build-scripts">ここで指定された</a>環境変数を介してスクリプトに入力を与えます。</p>
212+
<!--
213+
The script provides output via stdout. All lines printed are written to
214+
`target/debug/build/<pkg>/output`. Further, lines prefixed with `cargo:` will be
193215
interpreted by Cargo directly and hence can be used to define parameters for the
194-
package's compilation.</p>
195-
<p>For further specification and examples have a read of the
196-
<a href="https://doc.rust-lang.org/cargo/reference/build-scripts.html">Cargo specification</a>.</p>
216+
package's compilation.
217+
-->
218+
<p>スクリプトは標準出力に出力します。出力される行は全て、<code>target/debug/build/&lt;pkg&gt;/output</code>に書き込まれます。さらに、行頭に<code>cargo:</code>がついた行はCargoに直接解釈されるため、パッケージのコンパイル時のパラメーターを定義するのに使用できます。</p>
219+
<!--
220+
For further specification and examples have a read of the
221+
[Cargo specification][cargo_specification].
222+
-->
223+
<p>より詳細な仕様や例については、<a href="https://doc.rust-lang.org/cargo/reference/build-scripts.html">Cargo specification</a>を参照してください。</p>
197224

198225
</main>
199226

docs/cargo/conventions.html

Lines changed: 34 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -169,31 +169,52 @@ <h1 class="menu-title">Rust By Example 日本語版</h1>
169169

170170
<div id="content" class="content">
171171
<main>
172-
<h1><a class="header" href="#conventions" id="conventions">Conventions</a></h1>
173-
<p>In the previous chapter, we saw the following directory hierarchy:</p>
172+
<!--
173+
# Conventions
174+
-->
175+
<h1><a class="header" href="#慣例" id="慣例">慣例</a></h1>
176+
<!--
177+
In the previous chapter, we saw the following directory hierarchy:
178+
-->
179+
<p>前の章ではこのようなディレクトリ階層がありました。</p>
174180
<pre><code class="language-txt">foo
175181
├── Cargo.toml
176182
└── src
177183
└── main.rs
178184
</code></pre>
179-
<p>Suppose that we wanted to have two binaries in the same project, though. What
180-
then?</p>
181-
<p>It turns out that <code>cargo</code> supports this. The default binary name is <code>main</code>, as
182-
we saw before, but you can add additional binaries by placing them in a <code>bin/</code>
183-
directory:</p>
185+
<!--
186+
Suppose that we wanted to have two binaries in the same project, though. What
187+
then?
188+
-->
189+
<p>しかし同じプロジェクトで2つのバイナリが欲しいとします。その場合は?</p>
190+
<!--
191+
It turns out that `cargo` supports this. The default binary name is `main`, as
192+
we saw before, but you can add additional binaries by placing them in a `bin/`
193+
directory:
194+
-->
195+
<p><code>cargo</code>はこれもサポートしています。以前見た通りデフォルトのバイナリ名は<code>main</code>ですが、<code>bin/</code>ディレクトリに置くことで他のバイナリを追加できます。</p>
184196
<pre><code class="language-txt">foo
185197
├── Cargo.toml
186198
└── src
187199
├── main.rs
188200
└── bin
189201
└── my_other_bin.rs
190202
</code></pre>
191-
<p>To tell <code>cargo</code> to compile or run this binary as opposed to the default or other
192-
binaries, we just pass <code>cargo</code> the <code>--bin my_other_bin</code> flag, where <code>my_other_bin</code>
193-
is the name of the binary we want to work with.</p>
194-
<p>In addition to extra binaries, <code>cargo</code> supports <a href="https://doc.rust-lang.org/cargo/guide/project-layout.html">more features</a> such as
195-
benchmarks, tests, and examples.</p>
196-
<p>In the next chapter, we will look more closely at tests.</p>
203+
<!--
204+
To tell `cargo` to compile or run this binary as opposed to the default or other
205+
binaries, we just pass `cargo` the `--bin my_other_bin` flag, where `my_other_bin`
206+
is the name of the binary we want to work with.
207+
-->
208+
<p>デフォルトバイナリや他のバイナリではなく、このバイナリをコンパイルや実行するように<code>cargo</code>に伝えるには、<code>cargo</code><code>--bin my_other_bin</code>フラグを渡します。ここでは<code>my_other_bin</code>が対象のバイナリの名前です。</p>
209+
<!--
210+
In addition to extra binaries, `cargo` supports [more features] such as
211+
benchmarks, tests, and examples.
212+
-->
213+
<p>バイナリの追加に加えて、<code>cargo</code>はベンチマークやテスト、サンプルなどの<a href="https://doc.rust-lang.org/cargo/guide/project-layout.html">その他の機能</a>もサポートしています。</p>
214+
<!--
215+
In the next chapter, we will look more closely at tests.
216+
-->
217+
<p>次の章ではテストについてより詳しく見ていきます。</p>
197218

198219
</main>
199220

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy