diff --git a/po/ja.po b/po/ja.po index fb98fc9692..221d6d95fb 100644 --- a/po/ja.po +++ b/po/ja.po @@ -1,14 +1,14 @@ msgid "" msgstr "" "Project-Id-Version: Rust By Example\n" -"POT-Creation-Date: 2023-12-19T09:54:39+09:00\n" +"POT-Creation-Date: 2024-05-19T14:23:57+09:00\n" "PO-Revision-Date: 2023-12-19 09:55+0900\n" "Last-Translator: Naoya Hatta \n" "Language-Team: Japanese https://github.com/rust-lang-ja/rust-by-example\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: src/SUMMARY.md:1 @@ -781,9 +781,9 @@ msgid "" "focusing on safety, speed, and concurrency. It accomplishes these goals by " "being memory safe without using garbage collection." msgstr "" -"[Rust](https://www.rust-lang.org/) は安全性、速度、並列性にフォーカスした" -"現代的なシステムプログラミング用のプログラミング言語です。" -"ガベージコレクション無しでメモリ安全であることが、これを可能にしています。" +"[Rust](https://www.rust-lang.org/) は安全性、速度、並列性にフォーカスした現代" +"的なシステムプログラミング用のプログラミング言語です。ガベージコレクション無" +"しでメモリ安全であることが、これを可能にしています。" #: src/index.md:7 msgid "" @@ -794,11 +794,12 @@ msgid "" "std/). Additionally for the curious, you can also [check out the source " "code for this site](https://github.com/rust-lang/rust-by-example)." msgstr "" -"Rust by Example(RBE)はRustの実行可能なサンプルスクリプト集で、ここではRustの様々な" -"コンセプトと標準ライブラリを紹介していきます。" -"この例をより活用するためには[Rustをローカルにインストール](https://www.rust-lang.org/tools/install)し、" -"[公式ドキュメント](https://doc.rust-lang.org/std/)をチェックすることをおすすめします。" -"興味がある方は[このサイト自体のソース](https://github.com/rust-lang/rust-by-example)のチェックもどうぞ。" +"Rust by Example(RBE)はRustの実行可能なサンプルスクリプト集で、ここではRustの" +"様々なコンセプトと標準ライブラリを紹介していきます。この例をより活用するため" +"には[Rustをローカルにインストール](https://www.rust-lang.org/tools/install)" +"し、[公式ドキュメント](https://doc.rust-lang.org/std/)をチェックすることをお" +"すすめします。興味がある方は[このサイト自体のソース](https://github.com/rust-" +"lang/rust-by-example)のチェックもどうぞ。" #: src/index.md:12 msgid "Now let's begin!" @@ -806,13 +807,16 @@ msgstr "それでははじめましょう!" #: src/index.md:14 msgid "[Hello World](hello.md) - Start with a traditional Hello World program." -msgstr "[Hello World](hello.md) - お決まりのHello Worldプログラムから始めましょう。" +msgstr "" +"[Hello World](hello.md) - お決まりのHello Worldプログラムから始めましょう。" #: src/index.md:16 msgid "" "[Primitives](primitives.md) - Learn about signed integers, unsigned integers " "and other primitives." -msgstr "[基本データ型](primitives.md) - 符号付き整数や符号無し整数、その他の基本データ型について学びましょう。" +msgstr "" +"[基本データ型](primitives.md) - 符号付き整数や符号無し整数、その他の基本デー" +"タ型について学びましょう。" #: src/index.md:18 msgid "[Custom Types](custom_types.md) - `struct` and `enum`." @@ -822,7 +826,9 @@ msgstr "[カスタム型](custom_types.md) - `struct`と`enum`について。" msgid "" "[Variable Bindings](variable_bindings.md) - mutable bindings, scope, " "shadowing." -msgstr "[変数の束縛](variable_bindings.md) - ミュータブルな束縛、スコープ、シャドーイングについて。" +msgstr "" +"[変数の束縛](variable_bindings.md) - ミュータブルな束縛、スコープ、シャドーイ" +"ングについて。" #: src/index.md:22 msgid "[Types](types.md) - Learn about changing and defining types." @@ -832,7 +838,9 @@ msgstr "[型](types.md) - 型を変更したり定義したりすることを学 msgid "" "[Conversion](conversion.md) - Convert between different types, such as " "strings, integers, and floats." -msgstr "[型変換](conversion.md) - 文字列や整数、浮動小数点数など様々な型から型への変換について。" +msgstr "" +"[型変換](conversion.md) - 文字列や整数、浮動小数点数など様々な型から型への変" +"換について。" #: src/index.md:26 msgid "" @@ -857,57 +865,75 @@ msgstr "[モジュール](mod.md) - プログラムをモジュールを使っ msgid "" "[Crates](crates.md) - A crate is a compilation unit in Rust. Learn to create " "a library." -msgstr "[クレート](crates.md) - クレートは、Rustにおいてコンパイルされる単位です。ライブラリの作り方について学びます。" +msgstr "" +"[クレート](crates.md) - クレートは、Rustにおいてコンパイルされる単位です。ラ" +"イブラリの作り方について学びます。" #: src/index.md:36 msgid "" "[Cargo](cargo.md) - Go through some basic features of the official Rust " "package management tool." -msgstr "[Cargo](cargo.md) - Rustの公式パッケージマネージャの基本的な機能を学びます。" +msgstr "" +"[Cargo](cargo.md) - Rustの公式パッケージマネージャの基本的な機能を学びます。" #: src/index.md:38 msgid "" "[Attributes](attribute.md) - An attribute is metadata applied to some " "module, crate or item." -msgstr "[アトリビュート](attribute.md) - アトリビュートは、モジュールやクレート、要素に適用されるメタデータです。" +msgstr "" +"[アトリビュート](attribute.md) - アトリビュートは、モジュールやクレート、要素" +"に適用されるメタデータです。" #: src/index.md:40 msgid "" "[Generics](generics.md) - Learn about writing a function or data type which " "can work for multiple types of arguments." -msgstr "[ジェネリクス](generics.md) - 様々な型の引数を取れる関数やデータ型を書く方法を学びましょう。" +msgstr "" +"[ジェネリクス](generics.md) - 様々な型の引数を取れる関数やデータ型を書く方法" +"を学びましょう。" #: src/index.md:42 msgid "" "[Scoping rules](scope.md) - Scopes play an important part in ownership, " "borrowing, and lifetimes." -msgstr "[スコープの規則](scope.md) - スコープは所有権、借用、ライフタイムにおいて重要な役割を果たします。" +msgstr "" +"[スコープの規則](scope.md) - スコープは所有権、借用、ライフタイムにおいて重要" +"な役割を果たします。" #: src/index.md:44 msgid "" "[Traits](trait.md) - A trait is a collection of methods defined for an " "unknown type: `Self`" -msgstr "[トレイト](trait.md) - トレイトとは、未知の型`Self`に対して定義された一連のメソッドです。" +msgstr "" +"[トレイト](trait.md) - トレイトとは、未知の型`Self`に対して定義された一連のメ" +"ソッドです。" #: src/index.md:46 msgid "" "[Macros](macros.md) - Macros are a way of writing code that writes other " "code, which is known as metaprogramming." -msgstr "[マクロ](macros.md) - マクロはコードを書くためのコードです。メタプログラミングとしても知られています。" +msgstr "" +"[マクロ](macros.md) - マクロはコードを書くためのコードです。メタプログラミン" +"グとしても知られています。" #: src/index.md:48 msgid "[Error handling](error.md) - Learn Rust way of handling failures." -msgstr "[エラーハンドリング](error.md) - 失敗に対処するRust流のやり方を学びましょう。" +msgstr "" +"[エラーハンドリング](error.md) - 失敗に対処するRust流のやり方を学びましょう。" #: src/index.md:50 msgid "" "[Std library types](std.md) - Learn about some custom types provided by " "`std` library." -msgstr "[標準ライブラリの型](std.md) - `std`ライブラリによって提供されるいくつかのカスタム型について学びます。" +msgstr "" +"[標準ライブラリの型](std.md) - `std`ライブラリによって提供されるいくつかのカ" +"スタム型について学びます。" #: src/index.md:52 msgid "[Std misc](std_misc.md) - More custom types for file handling, threads." -msgstr "[標準ライブラリのその他](std_misc.md) - ファイルハンドリングとスレッドのためのカスタム型について。" +msgstr "" +"[標準ライブラリのその他](std_misc.md) - ファイルハンドリングとスレッドのため" +"のカスタム型について。" #: src/index.md:54 msgid "[Testing](testing.md) - All sorts of testing in Rust." @@ -971,11 +997,14 @@ msgstr "\"Hello World!\"" #: src/hello.md:23 msgid "`println!` is a [_macro_](macros.md) that prints text to the console." -msgstr "`println!`は文字列をコンソールに出力するための[ *マクロ* ](macros.md)です。" +msgstr "" +"`println!`は文字列をコンソールに出力するための[ *マクロ* ](macros.md)です。" #: src/hello.md:26 msgid "A binary can be generated using the Rust compiler: `rustc`." -msgstr "バイナリファイルは`rustc`と呼ばれるRustコンパイラを用いて生成することができます。" +msgstr "" +"バイナリファイルは`rustc`と呼ばれるRustコンパイラを用いて生成することができま" +"す。" #: src/hello.md:32 msgid "`rustc` will produce a `hello` binary that can be executed." @@ -983,7 +1012,7 @@ msgstr "すると`hello`という名前の実行可能なバイナリファイ #: src/hello.md:39 src/hello/print/print_display.md:107 #: src/hello/print/print_display/testcase_list.md:53 src/hello/print/fmt.md:70 -#: src/primitives/tuples.md:64 src/custom_types/structs.md:88 +#: src/primitives/tuples.md:64 src/custom_types/structs.md:89 msgid "Activity" msgstr "演習" @@ -992,13 +1021,15 @@ msgid "" "Click 'Run' above to see the expected output. Next, add a new line with a " "second `println!` macro so that the output shows:" msgstr "" -"上に書いている 'Run' をクリックしてアウトプットを見てみましょう。" -"次に、`println!`マクロをもう一行追加してアウトプットがどうなるか見てみましょう。" +"上に書いている 'Run' をクリックしてアウトプットを見てみましょう。次に、" +"`println!`マクロをもう一行追加してアウトプットがどうなるか見てみましょう。" #: src/hello/comment.md:3 msgid "" "Any program requires comments, and Rust supports a few different varieties:" -msgstr "あらゆるプログラムにはコメントが必要です。Rustには何種類かのコメントがあります" +msgstr "" +"あらゆるプログラムにはコメントが必要です。Rustには何種類かのコメントがありま" +"す" #: src/hello/comment.md:6 msgid "_Regular comments_ which are ignored by the compiler:" @@ -1016,7 +1047,9 @@ msgstr "`/* ブロックによって囲まれた部分をコメントアウト * msgid "" "_Doc comments_ which are parsed into HTML library [documentation](../meta/" "doc.md):" -msgstr "*ドキュメンテーションコメント* ライブラリの[ドキュメンテーション](../meta/doc.md)としてHTMLにパースされます。" +msgstr "" +"*ドキュメンテーションコメント* ライブラリの[ドキュメンテーション](../meta/" +"doc.md)としてHTMLにパースされます。" #: src/hello/comment.md:10 msgid "`/// Generate library docs for the following item.`" @@ -1072,7 +1105,8 @@ msgid "" " */" msgstr "" "/*\n" -" 注: 上のコメントにおける`*`列は見栄えのためでした。実際には必要ありません。\n" +" 注: 上のコメントにおける`*`列は見栄えのためでした。実際には必要ありませ" +"ん。\n" " */" #: src/hello/comment.md:37 @@ -1092,7 +1126,7 @@ msgstr "/* 90 + */" msgid "\"Is `x` 10 or 100? x = {}\"" msgstr "\"Is `x` 10 or 100? x = {}\"" -#: src/hello/comment.md:45 src/hello/print.md:104 +#: src/hello/comment.md:45 src/hello/print.md:103 #: src/hello/print/print_debug.md:75 src/hello/print/print_display.md:118 #: src/hello/print/print_display/testcase_list.md:62 src/hello/print/fmt.md:89 #: src/primitives.md:55 src/custom_types/enum.md:100 @@ -1107,7 +1141,7 @@ msgstr "\"Is `x` 10 or 100? x = {}\"" #: src/flow_control/match/destructuring/destructure_structures.md:45 #: src/flow_control/match/guard.md:43 src/flow_control/match/binding.md:49 #: src/flow_control/if_let.md:122 src/flow_control/let_else.md:57 -#: src/flow_control/while_let.md:54 src/fn/closures/capture.md:110 +#: src/flow_control/while_let.md:56 src/fn/closures/capture.md:110 #: src/fn/closures/input_parameters.md:84 src/fn/closures/anonymity.md:47 #: src/fn/closures/input_functions.md:32 #: src/fn/closures/output_parameters.md:49 @@ -1135,7 +1169,7 @@ msgstr "\"Is `x` 10 or 100? x = {}\"" #: src/error/multiple_error_types/wrap_error.md:91 src/std.md:12 #: src/std/rc.md:49 src/std_misc.md:12 #: src/std_misc/threads/testcase_mapreduce.md:128 src/std_misc/path.md:54 -#: src/std_misc/fs.md:150 src/meta/doc.md:112 src/meta/playground.md:49 +#: src/std_misc/fs.md:150 src/meta/doc.md:109 src/meta/playground.md:49 msgid "See also:" msgstr "参照" @@ -1147,17 +1181,24 @@ msgstr "[ライブラリドキュメンテーション](../meta/doc.md)" msgid "" "Printing is handled by a series of [`macros`](../macros.md) defined in " "[`std::fmt`](https://doc.rust-lang.org/std/fmt/) some of which include:" -msgstr "出力関係の機能は[`std::fmt`](https://doc.rust-lang.org/std/fmt/)で定義される幾つかの[マクロ](../macros.md)で扱うことができます。このマクロには以下が含まれます。" +msgstr "" +"出力関係の機能は[`std::fmt`](https://doc.rust-lang.org/std/fmt/)で定義される" +"幾つかの[マクロ](../macros.md)で扱うことができます。このマクロには以下が含ま" +"れます。" #: src/hello/print.md:6 msgid "`format!`: write formatted text to [`String`](../std/str.md)" -msgstr "`format!`:フォーマットされたテキストを[`String`](../std/str.md)に書き込みます。" +msgstr "" +"`format!`:フォーマットされたテキストを[`String`](../std/str.md)に書き込みま" +"す。" #: src/hello/print.md:7 msgid "" "`print!`: same as `format!` but the text is printed to the console (io::" "stdout)." -msgstr "`print!`:`format!`と同様ですが、コンソール (io::stdout) にそのテキストを出力します。" +msgstr "" +"`print!`:`format!`と同様ですが、コンソール (io::stdout) にそのテキストを出力" +"します。" #: src/hello/print.md:9 msgid "`println!`: same as `print!` but a newline is appended." @@ -1167,7 +1208,9 @@ msgstr "`println!`:`print!`と同じですが改行が付け加えられます msgid "" "`eprint!`: same as `print!` but the text is printed to the standard error " "(io::stderr)." -msgstr "`eprint!`:`format!`と同様ですが、標準エラー出力 (io::stderr) にそのテキストを出力します。" +msgstr "" +"`eprint!`:`format!`と同様ですが、標準エラー出力 (io::stderr) にそのテキスト" +"を出力します。" #: src/hello/print.md:12 msgid "`eprintln!`: same as `eprint!` but a newline is appended." @@ -1177,7 +1220,9 @@ msgstr "`eprintln!`:`eprint!`と同じですが改行が付け加えられま msgid "" "All parse text in the same fashion. As a plus, Rust checks formatting " "correctness at compile time." -msgstr "すべて同じやり方でテキストをパースし、正しくフォーマットできるかコンパイル時にチェックします。" +msgstr "" +"すべて同じやり方でテキストをパースし、正しくフォーマットできるかコンパイル時" +"にチェックします。" #: src/hello/print.md:19 msgid "" @@ -1199,7 +1244,8 @@ msgid "" " // at 0 immediately after the format string.\n" msgstr "" "// 位置引数を利用できます。\n" -" // `{}`の内側に整数を指定することで、どの引数で置換されるかが決まります。\n" +" // `{}`の内側に整数を指定することで、どの引数で置換されるかが決まりま" +"す。\n" " // 引数は0から始まります。\n" #: src/hello/print.md:26 @@ -1275,15 +1321,7 @@ msgstr "\"Base 16 (hexadecimal): {:x}\"" msgid "// 10f2c\n" msgstr "// 10f2c\n" -#: src/hello/print.md:40 -msgid "\"Base 16 (hexadecimal): {:X}\"" -msgstr "\"Base 16 (hexadecimal): {:X}\"" - -#: src/hello/print.md:40 -msgid "// 10F2C\n" -msgstr "// 10F2C\n" - -#: src/hello/print.md:42 +#: src/hello/print.md:41 msgid "" "// You can right-justify text with a specified width. This will\n" " // output \" 1\". (Four white spaces and a \"1\", for a total width " @@ -1292,19 +1330,19 @@ msgstr "" "// 特定の幅に右詰めすることもできます。この出力は \" 1\" になります。\n" " // (4つの空白と\"1\"で合計幅は5です)\n" -#: src/hello/print.md:44 +#: src/hello/print.md:43 msgid "\"{number:>5}\"" msgstr "\"{number:>5}\"" -#: src/hello/print.md:46 +#: src/hello/print.md:45 msgid "// You can pad numbers with extra zeroes,\n" msgstr "// 数字を0埋めすることもできます。\n" -#: src/hello/print.md:47 +#: src/hello/print.md:46 msgid "\"{number:0>5}\"" msgstr "\"{number:0>5}\"" -#: src/hello/print.md:47 +#: src/hello/print.md:46 msgid "" "// 00001\n" " // and left-adjust by flipping the sign. This will output \"10000\".\n" @@ -1312,41 +1350,42 @@ msgstr "" "// 00001\n" " // 記号を反対にすると左寄せになり、\"10000\"が出力されます。\n" -#: src/hello/print.md:49 +#: src/hello/print.md:48 msgid "\"{number:0<5}\"" msgstr "\"{number:0<5}\"" -#: src/hello/print.md:49 +#: src/hello/print.md:48 msgid "// 10000\n" msgstr "// 10000\n" -#: src/hello/print.md:51 +#: src/hello/print.md:50 msgid "" "// You can use named arguments in the format specifier by appending a `$`.\n" -msgstr "// フォーマット指定子の中に`$`をつけることで名前付き引数を利用できます。\n" +msgstr "" +"// フォーマット指定子の中に`$`をつけることで名前付き引数を利用できます。\n" -#: src/hello/print.md:52 +#: src/hello/print.md:51 msgid "\"{number:0>width$}\"" msgstr "\"{number:0>width$}\"" -#: src/hello/print.md:54 +#: src/hello/print.md:53 msgid "" "// Rust even checks to make sure the correct number of arguments are used.\n" msgstr "// 引数の数が正しいかのチェックも行ってくれます。\n" -#: src/hello/print.md:55 +#: src/hello/print.md:54 msgid "\"My name is {0}, {1} {0}\"" msgstr "\"My name is {0}, {1} {0}\"" -#: src/hello/print.md:55 +#: src/hello/print.md:54 msgid "\"Bond\"" msgstr "\"Bond\"" -#: src/hello/print.md:56 +#: src/hello/print.md:55 msgid "// FIXME ^ Add the missing argument: \"James\"\n" msgstr "// FIXME ^ 不足している引数 \"James\" を追加しましょう。\n" -#: src/hello/print.md:58 +#: src/hello/print.md:57 msgid "" "// Only types that implement fmt::Display can be formatted with `{}`. User-\n" " // defined types do not implement fmt::Display by default.\n" @@ -1354,11 +1393,11 @@ msgstr "" "// `{}`でフォーマットできるのは、fmt::Displayを実装している型のみです。\n" " // ユーザーが定義した型はデフォルトではfmt::Displayを実装していません。\n" -#: src/hello/print.md:61 +#: src/hello/print.md:60 msgid "// disable `dead_code` which warn against unused module\n" msgstr "// 未使用モジュールを警告する`dead_code`を無効化。\n" -#: src/hello/print.md:64 +#: src/hello/print.md:63 msgid "" "// This will not compile because `Structure` does not implement\n" " // fmt::Display.\n" @@ -1370,81 +1409,92 @@ msgstr "" " // println!(\"This struct `{}` won't print...\", Structure(3));\n" " // TODO ^ この行をアンコメントしてみましょう。\n" -#: src/hello/print.md:69 +#: src/hello/print.md:68 msgid "" "// For Rust 1.58 and above, you can directly capture the argument from a\n" " // surrounding variable. Just like the above, this will output\n" " // \" 1\", 4 white spaces and a \"1\".\n" msgstr "" "// Rust 1.58以上では、周囲の変数から直接引数に取ることができます。\n" -" // 上で見たように、以下のコードは4つのスペースと1を、\" 1\" と出力します。\n" +" // 上で見たように、以下のコードは4つのスペースと1を、\" 1\" と出力しま" +"す。\n" -#: src/hello/print.md:74 +#: src/hello/print.md:73 msgid "\"{number:>width$}\"" msgstr "\"{number:>width$}\"" -#: src/hello/print.md:78 +#: src/hello/print.md:77 msgid "" "[`std::fmt`](https://doc.rust-lang.org/std/fmt/) contains many [`traits`]" "(https://doc.rust-lang.org/std/fmt/#formatting-traits) which govern the " "display of text. The base form of two important ones are listed below:" msgstr "" -"[`std::fmt`](https://doc.rust-lang.org/std/fmt/)はいくつもの[トレイト](https://doc.rust-lang.org/std/fmt/#formatting-traits)を持ち、" -"それによってどのようにディスプレイに表示されるかが決まります。" -"特に大事な形式は以下の2つです。" +"[`std::fmt`](https://doc.rust-lang.org/std/fmt/)はいくつもの[トレイト]" +"(https://doc.rust-lang.org/std/fmt/#formatting-traits)を持ち、それによってど" +"のようにディスプレイに表示されるかが決まります。特に大事な形式は以下の2つで" +"す。" -#: src/hello/print.md:81 +#: src/hello/print.md:80 msgid "" "`fmt::Debug`: Uses the `{:?}` marker. Format text for debugging purposes." msgstr "`fmt::Debug`:`{:?}`というマーカーを使用し、デバッグ目的に使われます。" -#: src/hello/print.md:82 +#: src/hello/print.md:81 msgid "" "`fmt::Display`: Uses the `{}` marker. Format text in a more elegant, user " "friendly fashion." -msgstr "`fmt::Display`:`{}`というマーカーを使用し、より美しく、ユーザフレンドリーに表示します。" +msgstr "" +"`fmt::Display`:`{}`というマーカーを使用し、より美しく、ユーザフレンドリーに" +"表示します。" -#: src/hello/print.md:85 +#: src/hello/print.md:84 msgid "" "Here, we used `fmt::Display` because the std library provides " "implementations for these types. To print text for custom types, more steps " "are required." msgstr "" -"この例で用いられている型は、標準ライブラリに含まれているため、ここでは`fmt::Display`を使用しています。" -"カスタム型をテキストとして表示する場合は、さらに手順が必要です。" +"この例で用いられている型は、標準ライブラリに含まれているため、ここでは`fmt::" +"Display`を使用しています。カスタム型をテキストとして表示する場合は、さらに手" +"順が必要です。" -#: src/hello/print.md:88 +#: src/hello/print.md:87 msgid "" "Implementing the `fmt::Display` trait automatically implements the " "[`ToString`](https://doc.rust-lang.org/std/string/trait.ToString.html) trait " "which allows us to [convert](../conversion/string.md) the type to [`String`]" "(../std/str.md)." msgstr "" -"`fmt::Display`トレイトを実装すると、自動的に[`ToString`](https://doc.rust-lang.org/std/string/trait.ToString.html)トレイトが実装されます。" -"これにより[`String`](../std/str.md)型への[型変換](../conversion/string.md)ができるようになります。" +"`fmt::Display`トレイトを実装すると、自動的に[`ToString`](https://doc.rust-" +"lang.org/std/string/trait.ToString.html)トレイトが実装されます。これにより" +"[`String`](../std/str.md)型への[型変換](../conversion/string.md)ができるよう" +"になります。" -#: src/hello/print.md:91 +#: src/hello/print.md:90 msgid "" "In _line 43_, `#[allow(dead_code)]` is an [attribute](../attribute.md) which " -"only apply to the module after it." -msgstr "*43行目* の`#[allow(dead_code)]`は、直後のモジュールにのみ適用される[アトリビュート](../attribute.md)です。" +"only applies to the module after it." +msgstr "" +"*43行目* の`#[allow(dead_code)]`は、直後のモジュールにのみ適用される[アトリ" +"ビュート](../attribute.md)です。" -#: src/hello/print.md:93 +#: src/hello/print.md:92 msgid "Activities" msgstr "演習" -#: src/hello/print.md:95 +#: src/hello/print.md:94 msgid "" "Fix the issue in the above code (see FIXME) so that it runs without error." msgstr "上の例(FIXME を参照)を実行した際に生じるエラーを修復しましょう。" -#: src/hello/print.md:97 +#: src/hello/print.md:96 msgid "" "Try uncommenting the line that attempts to format the `Structure` struct " "(see TODO)" -msgstr "`Structure`構造体をフォーマットする行をアンコメントしてみましょう。(TODO を参照)" +msgstr "" +"`Structure`構造体をフォーマットする行をアンコメントしてみましょう。(TODO を" +"参照)" -#: src/hello/print.md:99 +#: src/hello/print.md:98 msgid "" "Add a `println!` macro call that prints: `Pi is roughly 3.142` by " "controlling the number of decimal places shown. For the purposes of this " @@ -1452,19 +1502,21 @@ msgid "" "to check the [`std::fmt`](https://doc.rust-lang.org/std/fmt/) documentation " "for setting the number of decimals to display)" msgstr "" -"`println!`マクロを追加し、表示される小数部の桁数を調整して`Pi is roughly 3.142`という文字列を出力しましょう。" -"ただし、円周率の値は`let pi = 3.141592`を使ってください。" -"(ヒント:小数部の桁数を調整する方法については、[`std::fmt`](https://doc.rust-lang.org/std/fmt/)をチェックする必要があるかもしれません。)" +"`println!`マクロを追加し、表示される小数部の桁数を調整して`Pi is roughly " +"3.142`という文字列を出力しましょう。ただし、円周率の値は`let pi = 3.141592`を" +"使ってください。(ヒント:小数部の桁数を調整する方法については、[`std::fmt`]" +"(https://doc.rust-lang.org/std/fmt/)をチェックする必要があるかもしれませ" +"ん。)" -#: src/hello/print.md:106 +#: src/hello/print.md:105 msgid "" "[`std::fmt`](https://doc.rust-lang.org/std/fmt/), [`macros`](../macros.md), " "[`struct`](../custom_types/structs.md), [`traits`](https://doc.rust-lang.org/" "std/fmt/#formatting-traits), and [`dead_code`](../attribute/unused.md)" msgstr "" -"[`std::fmt`](https://doc.rust-lang.org/std/fmt/), [マクロ](../macros.md), " -"[構造体](../custom_types/structs.md), [トレイト](https://doc.rust-lang.org/" -"std/fmt/#formatting-traits), [`dead_code`](../attribute/unused.md)" +"[`std::fmt`](https://doc.rust-lang.org/std/fmt/), [マクロ](../macros.md), [構" +"造体](../custom_types/structs.md), [トレイト](https://doc.rust-lang.org/std/" +"fmt/#formatting-traits), [`dead_code`](../attribute/unused.md)" #: src/hello/print/print_debug.md:3 msgid "" @@ -1472,7 +1524,10 @@ msgid "" "implementation to be printable. Automatic implementations are only provided " "for types such as in the `std` library. All others _must_ be manually " "implemented somehow." -msgstr "`std::fmt`のフォーマット用`トレイト`を使用したい型は、出力できるように実装されている必要があります。`std`ライブラリの型のように自動で出力可能なものもありますが、他はすべて *手動で実装する必要があります。*" +msgstr "" +"`std::fmt`のフォーマット用`トレイト`を使用したい型は、出力できるように実装さ" +"れている必要があります。`std`ライブラリの型のように自動で出力可能なものもあり" +"ますが、他はすべて *手動で実装する必要があります。*" #: src/hello/print/print_debug.md:8 msgid "" @@ -1480,8 +1535,9 @@ msgid "" "`derive` (automatically create) the `fmt::Debug` implementation. This is not " "true for `fmt::Display` which must be manually implemented." msgstr "" -"`fmt::Debug`という`トレイト`はこれを簡略化します。 *すべての* 型は`fmt::Debug`の実装を`導出(derive)`、(すなわち自動で作成)することができるためです。" -"`fmt::Display`の場合はやはり手動で実装しなくてはなりません。" +"`fmt::Debug`という`トレイト`はこれを簡略化します。 *すべての* 型は`fmt::" +"Debug`の実装を`導出(derive)`、(すなわち自動で作成)することができるためで" +"す。`fmt::Display`の場合はやはり手動で実装しなくてはなりません。" #: src/hello/print/print_debug.md:13 msgid "" @@ -1501,7 +1557,8 @@ msgstr "" #: src/hello/print/print_debug.md:23 msgid "All `std` library types are automatically printable with `{:?}` too:" -msgstr "`std`ライブラリの型の場合は、自動的に`{:?}`により出力可能になっています。" +msgstr "" +"`std`ライブラリの型の場合は、自動的に`{:?}`により出力可能になっています。" #: src/hello/print/print_debug.md:26 msgid "" @@ -1564,8 +1621,8 @@ msgid "" "So `fmt::Debug` definitely makes this printable but sacrifices some " "elegance. Rust also provides \"pretty printing\" with `{:#?}`." msgstr "" -"`fmt::Debug`は確実に出力可能にしてくれるのですが、一方である種の美しさを犠牲にしています。" -"Rustは`{:#?}`による「見栄えの良い出力」も提供します。" +"`fmt::Debug`は確実に出力可能にしてくれるのですが、一方である種の美しさを犠牲" +"にしています。Rustは`{:#?}`による「見栄えの良い出力」も提供します。" #: src/hello/print/print_debug.md:64 src/custom_types/structs.md:42 msgid "\"Peter\"" @@ -1600,10 +1657,10 @@ msgid "" "[`fmt::Display`](https://doc.rust-lang.org/std/fmt/), which uses the `{}` " "print marker. Implementing it looks like this:" msgstr "" -"`fmt::Debug`はコンパクトでクリーンであるようには見えませんね。" -"大抵の場合は、アウトプットの見た目をカスタマイズしたほうが好ましいでしょう。" -"これは`{}`を使用する[`fmt::Display`](https://doc.rust-lang.org/std/fmt/)を手動で実装することで可能です。" -"実装はこのようになります。" +"`fmt::Debug`はコンパクトでクリーンであるようには見えませんね。大抵の場合は、" +"アウトプットの見た目をカスタマイズしたほうが好ましいでしょう。これは`{}`を使" +"用する[`fmt::Display`](https://doc.rust-lang.org/std/fmt/)を手動で実装するこ" +"とで可能です。実装はこのようになります。" #: src/hello/print/print_display.md:9 msgid "// Import (via `use`) the `fmt` module to make it available.\n" @@ -1623,11 +1680,13 @@ msgid "" "// manually for the type.\n" msgstr "" "// `{}` というマーカーを使用するためには、\n" -"// この型専用の`fmt::Display`というトレイトが実装されていなくてはなりません。\n" +"// この型専用の`fmt::Display`というトレイトが実装されていなくてはなりませ" +"ん。\n" #: src/hello/print/print_display.md:19 msgid "// This trait requires `fmt` with this exact signature.\n" -msgstr "// このトレイトは`fmt`が正確にこの通りのシグネチャであることを要求します。\n" +msgstr "" +"// このトレイトは`fmt`が正確にこの通りのシグネチャであることを要求します。\n" #: src/hello/print/print_display.md:21 msgid "" @@ -1639,7 +1698,8 @@ msgid "" msgstr "" "// 最初の要素だけを、与えられた出力ストリーム`f`に書き込みます。\n" " // 操作が成功したかどうかを表す`fmt::Result`を返します。\n" -" // `write!`は`println!`に非常によく似た文法を使用していることに注目。\n" +" // `write!`は`println!`に非常によく似た文法を使用していることに注" +"目。\n" #: src/hello/print/print_display.md:25 #: src/hello/print/print_display/testcase_list.md:13 @@ -1666,10 +1726,10 @@ msgid "" "if the `std` library implemented a single style for all `Vec`, what style " "should it be? Would it be either of these two?" msgstr "" -"`fmt::Display`は`fmt::Debug`より綺麗かもしれませんが、`std`ライブラリの場合は問題が生じます。" -"曖昧な型はどのように表示すれば良いでしょう?" -"例えば、`std`ライブラリがあらゆる`Vec`に対して単一のスタイルを提供していた場合、" -"どのようなスタイルに整形すればよいでしょう?以下の2つのどちらかを選ぶべきでしょうか?" +"`fmt::Display`は`fmt::Debug`より綺麗かもしれませんが、`std`ライブラリの場合は" +"問題が生じます。曖昧な型はどのように表示すれば良いでしょう?例えば、`std`ライ" +"ブラリがあらゆる`Vec`に対して単一のスタイルを提供していた場合、どのような" +"スタイルに整形すればよいでしょう?以下の2つのどちらかを選ぶべきでしょうか?" #: src/hello/print/print_display.md:35 msgid "`Vec`: `/:/etc:/home/username:/bin` (split on `:`)" @@ -1686,16 +1746,18 @@ msgid "" "`Vec` or for any other generic containers. `fmt::Debug` must then be used " "for these generic cases." msgstr "" -"答えはNOです。あらゆる型に対して理想的なスタイルなどというものはありませんし、" -"`std`ライブラリによってそれが提供されているわけでもありません。" -"`fmt::Display`は`Vec`のようなジェネリックなコンテナ用に定義されているわけではありませんので、" -"このような場合は`fmt::Debug`を使用するべきです。" +"答えはNOです。あらゆる型に対して理想的なスタイルなどというものはありません" +"し、`std`ライブラリによってそれが提供されているわけでもありません。`fmt::" +"Display`は`Vec`のようなジェネリックなコンテナ用に定義されているわけではあ" +"りませんので、このような場合は`fmt::Debug`を使用するべきです。" #: src/hello/print/print_display.md:43 msgid "" "This is not a problem though because for any new _container_ type which is " "_not_ generic, `fmt::Display` can be implemented." -msgstr "ジェネリック *でない* コンテナ型の場合は、このような問題は生じませんので問題なく`fmt::Display`を実装することができます。" +msgstr "" +"ジェネリック *でない* コンテナ型の場合は、このような問題は生じませんので問題" +"なく`fmt::Display`を実装することができます。" #: src/hello/print/print_display.md:47 msgid "// Import `fmt`\n" @@ -1724,7 +1786,8 @@ msgstr "\"({}, {})\"" #: src/hello/print/print_display.md:61 msgid "// Define a structure where the fields are nameable for comparison.\n" -msgstr "// 比較のため、フィールドに名前をつけられる様な構造体を定義しましょう。\n" +msgstr "" +"// 比較のため、フィールドに名前をつけられる様な構造体を定義しましょう。\n" #: src/hello/print/print_display.md:68 msgid "// Similarly, implement `Display` for `Point2D`.\n" @@ -1776,9 +1839,10 @@ msgid "" "implementation. This is detailed further in [`std::fmt`](https://doc.rust-" "lang.org/std/fmt/)." msgstr "" -"`fmt::Display`は実装されていますが、`fmt::Binary`はされていないので使用できません。" -"`std::fmt`にはそのような[トレイト](https://doc.rust-lang.org/std/fmt/#formatting-traits)が数多くあり、" -"それぞれに独自の実装が必要です。詳しくは[`std::fmt`](https://doc.rust-lang.org/std/fmt/)を参照してください。" +"`fmt::Display`は実装されていますが、`fmt::Binary`はされていないので使用できま" +"せん。`std::fmt`にはそのような[トレイト](https://doc.rust-lang.org/std/fmt/" +"#formatting-traits)が数多くあり、それぞれに独自の実装が必要です。詳しくは" +"[`std::fmt`](https://doc.rust-lang.org/std/fmt/)を参照してください。" #: src/hello/print/print_display.md:109 msgid "" @@ -1786,8 +1850,9 @@ msgid "" "a guide to add a `Complex` struct to the example. When printed in the same " "way, the output should be:" msgstr "" -"上記の例のアウトプットを確認し、`Point2D`構造体を参考として、複素数を格納するための`Complex`構造体を定義しましょう。" -"うまく行けば以下のように出力されるはずです。" +"上記の例のアウトプットを確認し、`Point2D`構造体を参考として、複素数を格納する" +"ための`Complex`構造体を定義しましょう。うまく行けば以下のように出力されるはず" +"です。" #: src/hello/print/print_display.md:120 msgid "" @@ -1796,10 +1861,10 @@ msgid "" "structs.md), [`trait`](https://doc.rust-lang.org/std/fmt/#formatting-" "traits), and [`use`](../../mod/use.md)" msgstr "" -"[導出](../../trait/derive.md), [`std::fmt`](https://doc.rust-lang.org/" -"std/fmt/), [マクロ](../../macros.md), [構造体](../../custom_types/" -"structs.md), [トレイト](https://doc.rust-lang.org/std/fmt/#formatting-" -"traits), [`use`](../../mod/use.md)" +"[導出](../../trait/derive.md), [`std::fmt`](https://doc.rust-lang.org/std/" +"fmt/), [マクロ](../../macros.md), [構造体](../../custom_types/structs.md), " +"[トレイト](https://doc.rust-lang.org/std/fmt/#formatting-traits), [`use`]" +"(../../mod/use.md)" #: src/hello/print/print_display/testcase_list.md:3 msgid "" @@ -1808,10 +1873,10 @@ msgid "" "a `fmt::Result`. Proper handling of this requires dealing with _all_ the " "results. Rust provides the `?` operator for exactly this purpose." msgstr "" -"構造体のそれぞれの要素を別々に扱う`fmt::Display`を実装するのはトリッキーです。" -"というのも、それぞれの`write!`が別々の`fmt::Result`を生成するためです。" -"適切に処理するためには *すべての* 結果に対して処理を書かなくてはなりません。" -"このような場合は`?`演算子が使えます。" +"構造体のそれぞれの要素を別々に扱う`fmt::Display`を実装するのはトリッキーで" +"す。というのも、それぞれの`write!`が別々の`fmt::Result`を生成するためです。適" +"切に処理するためには *すべての* 結果に対して処理を書かなくてはなりません。こ" +"のような場合は`?`演算子が使えます。" #: src/hello/print/print_display/testcase_list.md:8 msgid "Using `?` on `write!` looks like this:" @@ -1821,7 +1886,9 @@ msgstr "以下のように`?`を`write!`に対して使用します。" msgid "" "// Try `write!` to see if it errors. If it errors, return\n" "// the error. Otherwise continue.\n" -msgstr "// `write!`を実行し、エラーが生じた場合はエラーを返します。そうでなければ実行を継続します。\n" +msgstr "" +"// `write!`を実行し、エラーが生じた場合はエラーを返します。そうでなければ実行" +"を継続します。\n" #: src/hello/print/print_display/testcase_list.md:16 msgid "" @@ -1881,8 +1948,8 @@ msgid "" "Try changing the program so that the index of each element in the vector is " "also printed. The new output should look like this:" msgstr "" -"上記のプログラムを変更して、ベクタの各要素のインデックスも表示するようにしてみましょう。" -"変更後の出力は次のようになります。" +"上記のプログラムを変更して、ベクタの各要素のインデックスも表示するようにして" +"みましょう。変更後の出力は次のようになります。" #: src/hello/print/print_display/testcase_list.md:64 msgid "" @@ -1893,12 +1960,14 @@ msgid "" msgstr "" "[`for`](../../../flow_control/for.md), [`ref`](../../../scope/borrow/ref." "md), [`Result`](../../../std/result.md), [構造体](../../../custom_types/" -"structs.md), [`?`](../../../std/result/question_mark.md), [`vec!`]" -"(../../../std/vec.md)" +"structs.md), [`?`](../../../std/result/question_mark.md), [`vec!`](../../../" +"std/vec.md)" #: src/hello/print/fmt.md:3 msgid "We've seen that formatting is specified via a _format string_:" -msgstr "これまで、文字列がどのようにフォーマットされるかは *フォーマット文字列* によって決まるということを見てきました 。" +msgstr "" +"これまで、文字列がどのようにフォーマットされるかは *フォーマット文字列* に" +"よって決まるということを見てきました 。" #: src/hello/print/fmt.md:5 msgid "`format!(\"{}\", foo)` -> `\"3735928559\"`" @@ -1920,7 +1989,9 @@ msgstr "`format!(\"0o{:o}\", foo)` -> `\"0o33653337357\"`" msgid "" "The same variable (`foo`) can be formatted differently depending on which " "_argument type_ is used: `X` vs `o` vs _unspecified_." -msgstr "ここでは(`foo`)という単一の変数が`X`、`o`、 *指定なし* 、という様々な *引数タイプ* に応じてフォーマットされています。" +msgstr "" +"ここでは(`foo`)という単一の変数が`X`、`o`、 *指定なし* 、という様々な *引数" +"タイプ* に応じてフォーマットされています。" #: src/hello/print/fmt.md:12 msgid "" @@ -1929,8 +2000,9 @@ msgid "" "which handles cases where the argument type is left unspecified: `{}` for " "instance." msgstr "" -"フォーマットの機能はそれぞれの引数タイプごとに個別のトレイトを用いて実装されています。" -"最も一般的なトレイトは`Display`で、これは引数タイプが未指定(たとえば`{}`)の時に呼び出されます。" +"フォーマットの機能はそれぞれの引数タイプごとに個別のトレイトを用いて実装され" +"ています。最も一般的なトレイトは`Display`で、これは引数タイプが未指定(たとえ" +"ば`{}`)の時に呼び出されます。" #: src/hello/print/fmt.md:21 msgid "// Latitude\n" @@ -1992,7 +2064,8 @@ msgstr "\"Vancouver\"" msgid "" "// Switch this to use {} once you've added an implementation\n" " // for fmt::Display.\n" -msgstr "// fmt::Displayに実装を追加したら、 {} を使用するように変更してください。\n" +msgstr "" +"// fmt::Displayに実装を追加したら、 {} を使用するように変更してください。\n" #: src/hello/print/fmt.md:62 src/primitives/tuples.md:60 #: src/custom_types/structs.md:47 src/types/inference.md:23 @@ -2008,16 +2081,17 @@ msgid "" "std/fmt/#formatting-traits) and their argument types in the [`std::fmt`]" "(https://doc.rust-lang.org/std/fmt/) documentation." msgstr "" -"フォーマット用トレイトの全リストは[こちら](https://doc.rust-lang.org/std/fmt/#formatting-traits)から、" -"引数タイプについては[`std::fmt`のドキュメンテーション](https://doc.rust-lang.org/std/fmt/)から参照できます。" +"フォーマット用トレイトの全リストは[こちら](https://doc.rust-lang.org/std/fmt/" +"#formatting-traits)から、引数タイプについては[`std::fmt`のドキュメンテーショ" +"ン](https://doc.rust-lang.org/std/fmt/)から参照できます。" #: src/hello/print/fmt.md:72 msgid "" "Add an implementation of the `fmt::Display` trait for the `Color` struct " "above so that the output displays as:" msgstr "" -"上にあるソースコード中の`Color`という構造体のための`fmt::Display`トレイトの実装を追加しましょう。" -"出力は以下のようになるはずです。" +"上にあるソースコード中の`Color`という構造体のための`fmt::Display`トレイトの実" +"装を追加しましょう。出力は以下のようになるはずです。" #: src/hello/print/fmt.md:81 msgid "Three hints if you get stuck:" @@ -2030,20 +2104,25 @@ msgid "" "see [RGB color format & calculation](https://www.rapidtables.com/web/color/" "RGB_Color.html#rgb-format)." msgstr "" -"RGB色空間で色を計算する式は`RGB = (R*65536)+(G*256)+B (R は RED, G は GREEN and B は BLUE)`です。" -"詳細は[RGB color format & calculation](https://www.rapidtables.com/web/color/RGB_Color.html#rgb-format)を参照。" +"RGB色空間で色を計算する式は`RGB = (R*65536)+(G*256)+B (R は RED, G は GREEN " +"and B は BLUE)`です。詳細は[RGB color format & calculation](https://www." +"rapidtables.com/web/color/RGB_Color.html#rgb-format)を参照。" #: src/hello/print/fmt.md:86 msgid "" "You [may need to list each color more than once](https://doc.rust-lang.org/" "std/fmt/#named-parameters)." -msgstr "[それぞれの色を2回以上記述する必要があるかもしれません。](https://doc.rust-lang.org/std/fmt/#named-parameters)" +msgstr "" +"[それぞれの色を2回以上記述する必要があるかもしれません。](https://doc.rust-" +"lang.org/std/fmt/#named-parameters)" #: src/hello/print/fmt.md:87 msgid "" "You can [pad with zeros to a width of 2](https://doc.rust-lang.org/std/fmt/" "#width) with `:0>2`." -msgstr "`:0>2`で、[幅を2に指定し、空白を0で埋める事ができます。](https://doc.rust-lang.org/std/fmt/#width)" +msgstr "" +"`:0>2`で、[幅を2に指定し、空白を0で埋める事ができます。](https://doc.rust-" +"lang.org/std/fmt/#width)" #: src/hello/print/fmt.md:91 msgid "[`std::fmt`](https://doc.rust-lang.org/std/fmt/)" @@ -2061,13 +2140,15 @@ msgstr "スカラー型" #: src/primitives.md:7 msgid "" "Signed integers: `i8`, `i16`, `i32`, `i64`, `i128` and `isize` (pointer size)" -msgstr "符号付き整数:`i8`, `i16`, `i32`, `i64`, `i128`, `isize`(ポインタのサイズ)" +msgstr "" +"符号付き整数:`i8`, `i16`, `i32`, `i64`, `i128`, `isize`(ポインタのサイズ)" #: src/primitives.md:8 msgid "" "Unsigned integers: `u8`, `u16`, `u32`, `u64`, `u128` and `usize` (pointer " "size)" -msgstr "符号無し整数:`u8`, `u16`, `u32`, `u64`, `u128`, `usize`(ポインタのサイズ)" +msgstr "" +"符号無し整数:`u8`, `u16`, `u32`, `u64`, `u128`, `usize`(ポインタのサイズ)" #: src/primitives.md:10 msgid "Floating point: `f32`, `f64`" @@ -2075,7 +2156,8 @@ msgstr "浮動小数点数:`f32`, `f64`" #: src/primitives.md:11 msgid "`char` Unicode scalar values like `'a'`, `'α'` and `'∞'` (4 bytes each)" -msgstr "`char`:`'a'`, `'α'`, `'∞'`などのUnicodeのスカラー値(それぞれ4バイト)" +msgstr "" +"`char`:`'a'`, `'α'`, `'∞'`などのUnicodeのスカラー値(それぞれ4バイト)" #: src/primitives.md:12 msgid "`bool` either `true` or `false`" @@ -2089,7 +2171,9 @@ msgstr "ユニット型 `()`:唯一の値として空のタプル`()`を持つ msgid "" "Despite the value of a unit type being a tuple, it is not considered a " "compound type because it does not contain multiple values." -msgstr "ユニット型はその値がタプルですが、複合型とはみなされません。内部に複数の値を含んでいるわけではないからです。" +msgstr "" +"ユニット型はその値がタプルですが、複合型とはみなされません。内部に複数の値を" +"含んでいるわけではないからです。" #: src/primitives.md:18 msgid "Compound Types" @@ -2109,9 +2193,9 @@ msgid "" "annotated via a _suffix_ or _by default_. Integers default to `i32` and " "floats to `f64`. Note that Rust can also infer types from context." msgstr "" -"変数は常に *型指定* できます。数値型の場合はさらにサフィックスでの指定も可能です。" -"指定しない場合デフォルトになります。整数は`i32`が、浮動小数点は`f64`がデフォルトです。" -"また、Rustは文脈から型を推論することもできます。" +"変数は常に *型指定* できます。数値型の場合はさらにサフィックスでの指定も可能" +"です。指定しない場合デフォルトになります。整数は`i32`が、浮動小数点は`f64`が" +"デフォルトです。また、Rustは文脈から型を推論することもできます。" #: src/primitives.md:29 msgid "// Variables can be type annotated.\n" @@ -2168,30 +2252,32 @@ msgid "" "[`shadowing`](variable_bindings/scope.md)" msgstr "" "[`std` ライブラリ](https://doc.rust-lang.org/std/), [`mut`]" -"(variable_bindings/mut.md), [型推論](types/inference.md), " -"[シャドーイング](variable_bindings/scope.md)" +"(variable_bindings/mut.md), [型推論](types/inference.md), [シャドーイング]" +"(variable_bindings/scope.md)" #: src/primitives/literals.md:3 msgid "" "Integers `1`, floats `1.2`, characters `'a'`, strings `\"abc\"`, booleans " "`true` and the unit type `()` can be expressed using literals." msgstr "" -"整数`1`、浮動小数点数`1.2`、文字`'a'`、文字列`\"abc\"`、ブーリアン`true`、" -"ユニット`()`は、リテラルを使って表すことが可能です。" +"整数`1`、浮動小数点数`1.2`、文字`'a'`、文字列`\"abc\"`、ブーリアン`true`、ユ" +"ニット`()`は、リテラルを使って表すことが可能です。" #: src/primitives/literals.md:6 msgid "" "Integers can, alternatively, be expressed using hexadecimal, octal or binary " "notation using these prefixes respectively: `0x`, `0o` or `0b`." -msgstr "また整数型の場合、プレフィックスに`0x`、`0o`、`0b`を指定することでそれぞれ16進数、8進数、2進数を使って表すことができます。" +msgstr "" +"また整数型の場合、プレフィックスに`0x`、`0o`、`0b`を指定することでそれぞれ16" +"進数、8進数、2進数を使って表すことができます。" #: src/primitives/literals.md:9 msgid "" "Underscores can be inserted in numeric literals to improve readability, e.g. " "`1_000` is the same as `1000`, and `0.000_001` is the same as `0.000001`." msgstr "" -"可読性のため、`_`(アンダースコア)を数値リテラルの間に挿入することができます。" -"例えば`1_000`は`1000`と、`0.000_001`は`0.000001`とそれぞれ同一です。" +"可読性のため、`_`(アンダースコア)を数値リテラルの間に挿入することができま" +"す。例えば`1_000`は`1000`と、`0.000_001`は`0.000001`とそれぞれ同一です。" #: src/primitives/literals.md:12 msgid "" @@ -2199,8 +2285,9 @@ msgid "" "Scientific_notation#E_notation), e.g. `1e6`, `7.6e-4`. The associated type " "is `f64`." msgstr "" -"また、Rustは`1e6`や`7.6e-4`などの科学的な[E表記](https://en.wikipedia.org/wiki/Scientific_notation#E_notation)をサポートしています。" -"この表記は`f64`になります。" +"また、Rustは`1e6`や`7.6e-4`などの科学的な[E表記](https://en.wikipedia.org/" +"wiki/Scientific_notation#E_notation)をサポートしています。この表記は`f64`にな" +"ります。" #: src/primitives/literals.md:15 msgid "" @@ -2208,9 +2295,9 @@ msgid "" "use the `u32` suffix to indicate that the literal is an unsigned 32-bit " "integer, and the `i32` suffix to indicate that it's a signed 32-bit integer." msgstr "" -"コンパイラに、リテラルの型を伝えたい場合があります。" -"現在の仕様では、リテラルが32ビット符号無し整数であることを伝える場合、" -"`u32`サフィックスを、符号付き32ビット整数であれば`i32`サフィックスを使用します。" +"コンパイラに、リテラルの型を伝えたい場合があります。現在の仕様では、リテラル" +"が32ビット符号無し整数であることを伝える場合、`u32`サフィックスを、符号付き32" +"ビット整数であれば`i32`サフィックスを使用します。" #: src/primitives/literals.md:19 msgid "" @@ -2219,8 +2306,9 @@ msgid "" "[C-like languages](https://en.wikipedia.org/wiki/" "Operator_precedence#Programming_languages)." msgstr "" -"Rustで使用可能な[演算子とその優先順位](https://doc.rust-lang.org/reference/expressions.html#expression-precedence)" -"は、[Cなどの言語のもの](https://en.wikipedia.org/wiki/Operator_precedence#Programming_languages)とほぼ同じです。" +"Rustで使用可能な[演算子とその優先順位](https://doc.rust-lang.org/reference/" +"expressions.html#expression-precedence)は、[Cなどの言語のもの](https://en." +"wikipedia.org/wiki/Operator_precedence#Programming_languages)とほぼ同じです。" #: src/primitives/literals.md:24 msgid "// Integer addition\n" @@ -2241,7 +2329,9 @@ msgstr "\"1 - 2 = {}\"" #: src/primitives/literals.md:29 msgid "" "// TODO ^ Try changing `1i32` to `1u32` to see why the type is important\n" -msgstr "// TODO ^ 型が重要であることを実感するため`1i32`を`1u32`に変更してみましょう。\n" +msgstr "" +"// TODO ^ 型が重要であることを実感するため`1i32`を`1u32`に変更してみましょ" +"う。\n" #: src/primitives/literals.md:31 msgid "// Scientific notation\n" @@ -2307,10 +2397,10 @@ msgid "" "can use tuples to return multiple values, as tuples can hold any number of " "values." msgstr "" -"タプルは異なる型の値の集合です。括弧`()`を用いて生成します。" -"タプル自体がそのメンバに対する型シグネチャを保持していますので、" -"明示すると`(T1, T2, ...)`のようになります。" -"タプルは大きさに制限がありませんので、関数が複数の値を返したい時に使われます。" +"タプルは異なる型の値の集合です。括弧`()`を用いて生成します。タプル自体がその" +"メンバに対する型シグネチャを保持していますので、明示すると`(T1, T2, ...)`のよ" +"うになります。タプルは大きさに制限がありませんので、関数が複数の値を返したい" +"時に使われます。" #: src/primitives/tuples.md:9 msgid "// Tuples can be used as function arguments and as return values.\n" @@ -2412,21 +2502,26 @@ msgid "" "example, so that if you switch from printing the debug format `{:?}` to the " "display format `{}`, you see the following output:" msgstr "" -"*復習* :上にある`Matrix`という構造体に、`fmt::Display`トレイトを追加しましょう。" -"デバッグフォーマット`{:?}`ではなくディスプレイフォーマット`{}`で出力すれば次のようになるはずです。" +"*復習* :上にある`Matrix`という構造体に、`fmt::Display`トレイトを追加しましょ" +"う。デバッグフォーマット`{:?}`ではなくディスプレイフォーマット`{}`で出力すれ" +"ば次のようになるはずです。" #: src/primitives/tuples.md:75 msgid "" "You may want to refer back to the example for [print display](../hello/print/" "print_display.md)." -msgstr "必要に応じて[ディスプレイのページ](../hello/print/print_display.md)に戻りましょう。" +msgstr "" +"必要に応じて[ディスプレイのページ](../hello/print/print_display.md)に戻りま" +"しょう。" #: src/primitives/tuples.md:76 msgid "" "Add a `transpose` function using the `reverse` function as a template, which " "accepts a matrix as an argument, and returns a matrix in which two elements " "have been swapped. For example:" -msgstr "`reverse`関数を雛形にした`transpose`関数を実装してください。この関数は`Matrix`を引数として受け取り、要素のうち2つを入れ替えたものを返します。つまり" +msgstr "" +"`reverse`関数を雛形にした`transpose`関数を実装してください。この関数は" +"`Matrix`を引数として受け取り、要素のうち2つを入れ替えたものを返します。つまり" #: src/primitives/tuples.md:81 msgid "\"Matrix:\\n{}\"" @@ -2447,8 +2542,9 @@ msgid "" "which is known at compile time, is part of their type signature `[T; " "length]`." msgstr "" -"配列は`T`という単一の型のオブジェクトの集合です。それらのオブジェクトはメモリ上の連続した領域に保存されます。" -"配列は`[]`を用いて生成されます。長さはコンパイル時には決定されていて、`[T; length]`という形で指定できます。" +"配列は`T`という単一の型のオブジェクトの集合です。それらのオブジェクトはメモリ" +"上の連続した領域に保存されます。配列は`[]`を用いて生成されます。長さはコンパ" +"イル時には決定されていて、`[T; length]`という形で指定できます。" #: src/primitives/array.md:7 msgid "" @@ -2459,10 +2555,11 @@ msgid "" "x86-64. Slices can be used to borrow a section of an array and have the type " "signature `&[T]`." msgstr "" -"スライスは配列に似ていますが、コンパイル時に長さが決定されていません。" -"スライスは2ワードからなるオブジェクトであり、最初のワードがデータへのポインタ、2番目のワードがスライスの長さです。" -"ワード長は`usize`と同一で、プロセッサのアーキテクチャによって決まります。" -"例えばx86-64では64ビットです。スライスは配列の一部を借用するのに使用され、`&[T]`という型シグネチャを持ちます。" +"スライスは配列に似ていますが、コンパイル時に長さが決定されていません。スライ" +"スは2ワードからなるオブジェクトであり、最初のワードがデータへのポインタ、2番" +"目のワードがスライスの長さです。ワード長は`usize`と同一で、プロセッサのアーキ" +"テクチャによって決まります。例えばx86-64では64ビットです。スライスは配列の一" +"部を借用するのに使用され、`&[T]`という型シグネチャを持ちます。" #: src/primitives/array.md:15 msgid "// This function borrows a slice.\n" @@ -2582,7 +2679,8 @@ msgstr "" #: src/custom_types.md:3 msgid "Rust custom data types are formed mainly through the two keywords:" -msgstr "Rustでのカスタムデータ型の作成は主に以下の2つのキーワードを介して行われます。" +msgstr "" +"Rustでのカスタムデータ型の作成は主に以下の2つのキーワードを介して行われます。" #: src/custom_types.md:5 msgid "`struct`: define a structure" @@ -2594,7 +2692,9 @@ msgstr "`enum`:列挙型を定義する" #: src/custom_types.md:8 msgid "Constants can also be created via the `const` and `static` keywords." -msgstr "`const`、あるいは`static`というキーワードによって定数を定義することもできます。" +msgstr "" +"`const`、あるいは`static`というキーワードによって定数を定義することもできま" +"す。" #: src/custom_types/structs.md:3 msgid "" @@ -2610,11 +2710,14 @@ msgstr "タプル構造体。(すなわちタプルに名前が付いたよう msgid "" "The classic [C structs](https://en.wikipedia.org/wiki/" "Struct_(C_programming_language))" -msgstr "クラシックな[C言語スタイルの構造体。](https://en.wikipedia.org/wiki/Struct_(C_programming_language))" +msgstr "" +"クラシックな[C言語スタイルの構造体。](https://en.wikipedia.org/wiki/" +"Struct_(C_programming_language))" #: src/custom_types/structs.md:8 msgid "Unit structs, which are field-less, are useful for generics." -msgstr "ユニット構造体。これはフィールドを持たず、ジェネリック型を扱う際に有効です。" +msgstr "" +"ユニット構造体。これはフィールドを持たず、ジェネリック型を扱う際に有効です。" #: src/custom_types/structs.md:11 src/custom_types/enum/enum_use.md:6 #: src/custom_types/enum/c_like.md:6 @@ -2641,7 +2744,8 @@ msgstr "// 構造体は他の構造体のフィールドになることができ msgid "" "// A rectangle can be specified by where the top left and bottom right\n" " // corners are in space.\n" -msgstr "// 長方形は座標空間上における左上隅と右下隅の位置によって指定できます。\n" +msgstr "" +"// 長方形は座標空間上における左上隅と右下隅の位置によって指定できます。\n" #: src/custom_types/structs.md:41 msgid "// Create struct with field init shorthand\n" @@ -2655,15 +2759,15 @@ msgstr "// 構造体のデバッグ表示\n" msgid "// Instantiate a `Point`\n" msgstr "// `Point`のインスタンス化\n" -#: src/custom_types/structs.md:52 +#: src/custom_types/structs.md:53 msgid "// Access the fields of the point\n" msgstr "// pointのフィールドにアクセスします。\n" -#: src/custom_types/structs.md:53 +#: src/custom_types/structs.md:54 msgid "\"point coordinates: ({}, {})\"" msgstr "\"point coordinates: ({}, {})\"" -#: src/custom_types/structs.md:55 +#: src/custom_types/structs.md:56 msgid "" "// Make a new point by using struct update syntax to use the fields of our\n" " // other one\n" @@ -2671,7 +2775,7 @@ msgstr "" "// 構造体の更新記法を用いて、別の構造体のフィールドの値を基に\n" " // 新たなpointを生成。\n" -#: src/custom_types/structs.md:59 +#: src/custom_types/structs.md:60 msgid "" "// `bottom_right.y` will be the same as `point.y` because we used that " "field\n" @@ -2680,63 +2784,68 @@ msgstr "" "// `bottom_right.y`の値は`point.y`と同一ですが、\n" " // これは`point`のフィールドの値を用いて生成したためです。\n" -#: src/custom_types/structs.md:61 +#: src/custom_types/structs.md:62 msgid "\"second point: ({}, {})\"" msgstr "\"second point: ({}, {})\"" -#: src/custom_types/structs.md:63 +#: src/custom_types/structs.md:64 msgid "// Destructure the point using a `let` binding\n" msgstr "// `let`を使用してpointをデストラクトします。\n" -#: src/custom_types/structs.md:67 +#: src/custom_types/structs.md:68 msgid "// struct instantiation is an expression too\n" msgstr "// 構造体の定義とインスタンスの作成を同時に行います。\n" -#: src/custom_types/structs.md:72 +#: src/custom_types/structs.md:73 msgid "// Instantiate a unit struct\n" msgstr "// ユニット構造体のインスタンス化\n" -#: src/custom_types/structs.md:75 +#: src/custom_types/structs.md:76 msgid "// Instantiate a tuple struct\n" msgstr "// タプル構造体のインスタンス化\n" -#: src/custom_types/structs.md:78 +#: src/custom_types/structs.md:79 msgid "// Access the fields of a tuple struct\n" msgstr "// タプル構造体のフィールドにアクセス\n" -#: src/custom_types/structs.md:79 src/custom_types/structs.md:84 +#: src/custom_types/structs.md:80 src/custom_types/structs.md:85 msgid "\"pair contains {:?} and {:?}\"" msgstr "\"pair contains {:?} and {:?}\"" -#: src/custom_types/structs.md:81 +#: src/custom_types/structs.md:82 msgid "// Destructure a tuple struct\n" msgstr "// タプル構造体のデストラクト\n" -#: src/custom_types/structs.md:90 +#: src/custom_types/structs.md:91 msgid "" "Add a function `rect_area` which calculates the area of a `Rectangle` (try " "using nested destructuring)." -msgstr "`Rectangle`の面積を計算する`rect_area`関数を追加してください。ネストしたデストラクトを使ってみましょう。" +msgstr "" +"`Rectangle`の面積を計算する`rect_area`関数を追加してください。ネストしたデス" +"トラクトを使ってみましょう。" -#: src/custom_types/structs.md:92 +#: src/custom_types/structs.md:93 msgid "" "Add a function `square` which takes a `Point` and a `f32` as arguments, and " "returns a `Rectangle` with its top left corner on the point, and a width and " "height corresponding to the `f32`." msgstr "" "`Point`と`f32`を引数とし、`Rectangle`を返す`square`関数を追加してください。" -"`Rectangle`の左上の点が`Point`になり、`f32`が`Rectangle`の幅と高さになります。" +"`Rectangle`の左上の点が`Point`になり、`f32`が`Rectangle`の幅と高さになりま" +"す。" -#: src/custom_types/structs.md:96 +#: src/custom_types/structs.md:97 msgid "See also" msgstr "参照" -#: src/custom_types/structs.md:98 +#: src/custom_types/structs.md:99 msgid "" -"[`attributes`](../attribute.md), and [destructuring](../flow_control/match/" -"destructuring.md)" +"[`attributes`](../attribute.md), [raw identifiers](../compatibility/" +"raw_identifiers.md) and [destructuring](../flow_control/match/destructuring." +"md)" msgstr "" -"[アトリビュート](../attribute.md), [デストラクト](../flow_control/match/" +"[アトリビュート](../attribute.md), [生識別子](../compatibility/" +"raw_identifiers.md), [デストラクト](../flow_control/match/" "destructuring.md)" #: src/custom_types/enum.md:3 @@ -2745,8 +2854,9 @@ msgid "" "different variants. Any variant which is valid as a `struct` is also valid " "in an `enum`." msgstr "" -"列挙型(`enum`)はいくつかの異なる要素型の中から1つを選ぶような場合に使用します。" -"構造体(`struct`)の定義を満たすものならば何でも`enum` の要素型として使用できます。" +"列挙型(`enum`)はいくつかの異なる要素型の中から1つを選ぶような場合に使用しま" +"す。構造体(`struct`)の定義を満たすものならば何でも`enum` の要素型として使用" +"できます。" #: src/custom_types/enum.md:8 msgid "" @@ -2813,7 +2923,8 @@ msgstr "'x'" #: src/custom_types/enum.md:41 msgid "// `to_owned()` creates an owned `String` from a string slice.\n" -msgstr "// `to_owned()`は文字列スライスから所有権のある`String`を作成します。\n" +msgstr "" +"// `to_owned()`は文字列スライスから所有権のある`String`を作成します。\n" #: src/custom_types/enum.md:42 msgid "\"my text\"" @@ -2829,8 +2940,8 @@ msgid "" "This might be useful if the enum's name is too long or too generic, and you " "want to rename it." msgstr "" -"型エイリアスを用いると、列挙型の要素型を別名で参照できます。" -"これは列挙型の名前があまりに長かったり、あまりに一般的だったりで改名したい場合に役立ちます。" +"型エイリアスを用いると、列挙型の要素型を別名で参照できます。これは列挙型の名" +"前があまりに長かったり、あまりに一般的だったりで改名したい場合に役立ちます。" #: src/custom_types/enum.md:67 msgid "// Creates a type alias\n" @@ -2841,13 +2952,16 @@ msgid "" "// We can refer to each variant via its alias, not its long and " "inconvenient\n" " // name.\n" -msgstr "// 長くて不便な列挙型の名前ではなく、別名を使って要素型を参照できます。\n" +msgstr "" +"// 長くて不便な列挙型の名前ではなく、別名を使って要素型を参照できます。\n" #: src/custom_types/enum.md:78 msgid "" "The most common place you'll see this is in `impl` blocks using the `Self` " "alias." -msgstr "このやり方がもっともよく見られるのは、`impl`ブロックで`Self`という別名を使用する場合です。" +msgstr "" +"このやり方がもっともよく見られるのは、`impl`ブロックで`Self`という別名を使用" +"する場合です。" #: src/custom_types/enum.md:96 msgid "" @@ -2855,8 +2969,9 @@ msgid "" "report](https://github.com/rust-lang/rust/pull/61682/" "#issuecomment-502472847) from when this feature was stabilized into Rust." msgstr "" -"列挙型や型エイリアスについて詳しく学びたい人は、この機能が安定してRustに取り込まれたときの" -"[stabilization report](https://github.com/rust-lang/rust/pull/61682/#issuecomment-502472847)を読んでください。" +"列挙型や型エイリアスについて詳しく学びたい人は、この機能が安定してRustに取り" +"込まれたときの[stabilization report](https://github.com/rust-lang/rust/" +"pull/61682/#issuecomment-502472847)を読んでください。" #: src/custom_types/enum.md:102 msgid "" @@ -2864,8 +2979,8 @@ msgid "" "str.md), [\"Type alias enum variants\" RFC](https://rust-lang.github.io/" "rfcs/2338-type-alias-enum-variants.html)" msgstr "" -"[`match`](../flow_control/match.md), [関数](../fn.md), [文字列](../std/" -"str.md), [\"Type alias enum variants\" RFC](https://rust-lang.github.io/" +"[`match`](../flow_control/match.md), [関数](../fn.md), [文字列](../std/str." +"md), [\"Type alias enum variants\" RFC](https://rust-lang.github.io/" "rfcs/2338-type-alias-enum-variants.html)" #: src/custom_types/enum/enum_use.md:3 @@ -2879,40 +2994,40 @@ msgid "" msgstr "// `use`することで絶対名でなくとも使用可能になります。\n" #: src/custom_types/enum/enum_use.md:23 -msgid "// Automatically `use` each name inside `Work`.\n" -msgstr "// `Work`の中の名前をすべて`use`します。\n" +msgid "// Automatically `use` each name inside `Role`.\n" +msgstr "// `Role`の中の名前をすべて`use`します。\n" #: src/custom_types/enum/enum_use.md:26 -msgid "// Equivalent to `Status::Poor`.\n" -msgstr "// `use`しているため、`Status::Poor`と同じです。\n" +msgid "// Equivalent to `Stage::Beginner`.\n" +msgstr "// `use`しているため、`Stage::Beginner`と同じです。\n" #: src/custom_types/enum/enum_use.md:28 -msgid "// Equivalent to `Work::Civilian`.\n" -msgstr "// `Work::Civilian`と同じ\n" +msgid "// Equivalent to `Role::Student`.\n" +msgstr "// `Role::Student`と同じ\n" #: src/custom_types/enum/enum_use.md:32 msgid "// Note the lack of scoping because of the explicit `use` above.\n" msgstr "// `use`しているのでスコープを明示していません。\n" #: src/custom_types/enum/enum_use.md:33 -msgid "\"The rich have lots of money!\"" -msgstr "\"The rich have lots of money!\"" +msgid "\"Beginners are starting their learning journey!\"" +msgstr "" #: src/custom_types/enum/enum_use.md:34 -msgid "\"The poor have no money...\"" -msgstr "\"The poor have no money...\"" +msgid "\"Advanced learners are mastering their subjects...\"" +msgstr "" #: src/custom_types/enum/enum_use.md:38 msgid "// Note again the lack of scoping.\n" msgstr "// こちらも同じ\n" #: src/custom_types/enum/enum_use.md:39 -msgid "\"Civilians work!\"" -msgstr "\"Civilians work!\"" +msgid "\"Students are acquiring knowledge!\"" +msgstr "" #: src/custom_types/enum/enum_use.md:40 -msgid "\"Soldiers fight!\"" -msgstr "\"Soldiers fight!\"" +msgid "\"Teachers are spreading knowledge!\"" +msgstr "" #: src/custom_types/enum/enum_use.md:47 msgid "[`match`](../../flow_control/match.md) and [`use`](../../mod/use.md) " @@ -2956,7 +3071,8 @@ msgstr "[キャスト](../../types/cast.md)" #: src/custom_types/enum/testcase_linked_list.md:3 msgid "A common way to implement a linked-list is via `enums`:" -msgstr "`enum`の使用が適切なパターンのひとつに、連結リストを作成する場合があります。" +msgstr "" +"`enum`の使用が適切なパターンのひとつに、連結リストを作成する場合があります。" #: src/custom_types/enum/testcase_linked_list.md:9 msgid "" @@ -3007,7 +3123,8 @@ msgid "" msgstr "" "// このメソッドは、`self`の状態によって振る舞いが\n" " // 変化するため、matchをする必要があります。\n" -" // `self`の型は`&List`なので、`*self`は`List`になります。マッチングは\n" +" // `self`の型は`&List`なので、`*self`は`List`になります。マッチング" +"は\n" " // 参照(`&T`)ではなく実体(`T`)に対して行うのが好ましいです。\n" " // Rust 2018以降ではここでselfと(refのない)tailを使うことができ、\n" " // &selfとref tailが推論されます。\n" @@ -3070,7 +3187,9 @@ msgstr "[`Box`](../../std/box.md), [メソッド](../../fn/methods.md)" msgid "" "Rust has two different types of constants which can be declared in any scope " "including global. Both require explicit type annotation:" -msgstr "Rustには2種類の定数があり、いずれもグローバルスコープを含む任意のスコープで宣言することができます。また、いずれも型を明示しなくてはなりません。" +msgstr "" +"Rustには2種類の定数があり、いずれもグローバルスコープを含む任意のスコープで宣" +"言することができます。また、いずれも型を明示しなくてはなりません。" #: src/custom_types/constants.md:6 msgid "`const`: An unchangeable value (the common case)." @@ -3083,8 +3202,8 @@ msgid "" "have to be specified. Accessing or modifying a mutable static variable is " "[`unsafe`](../unsafe.md)." msgstr "" -"`static`:[`'static`](../scope/lifetime/static_lifetime.md)ライフタイムを持つ変更可能な値。" -"スタティックライフタイムは推論され、明示する必要はありません。" +"`static`:[`'static`](../scope/lifetime/static_lifetime.md)ライフタイムを持つ" +"変更可能な値。スタティックライフタイムは推論され、明示する必要はありません。" "可変なスタティック値へのアクセスや変更は[安全ではありません](../unsafe.md)。" #: src/custom_types/constants.md:12 @@ -3152,8 +3271,9 @@ msgid "" "to infer the type of the variable from the context, heavily reducing the " "annotation burden." msgstr "" -"Rustは静的な型付けによる型安全性を提供します。変数束縛は宣言時に型を指定できます。" -"とはいえたいていの場合は、コンパイラは変数の型をコンテキストから推測することができますので、型指定の負担を大幅に軽減できます。" +"Rustは静的な型付けによる型安全性を提供します。変数束縛は宣言時に型を指定でき" +"ます。とはいえたいていの場合は、コンパイラは変数の型をコンテキストから推測す" +"ることができますので、型指定の負担を大幅に軽減できます。" #: src/variable_bindings.md:8 msgid "" @@ -3196,7 +3316,9 @@ msgstr "" msgid "" "Variable bindings are immutable by default, but this can be overridden using " "the `mut` modifier." -msgstr "変数はデフォルトでイミュータブル(変更不可能)ですが`mut`構文を使用することで変更可能になります。" +msgstr "" +"変数はデフォルトでイミュータブル(変更不可能)ですが`mut`構文を使用することで" +"変更可能になります。" #: src/variable_bindings/mut.md:11 msgid "\"Before mutation: {}\"" @@ -3212,7 +3334,8 @@ msgstr "\"After mutation: {}\"" #: src/variable_bindings/mut.md:18 msgid "// Error! Cannot assign a new value to an immutable variable\n" -msgstr "// エラー!イミュータブルな変数に新しい値を代入することはできません。\n" +msgstr "" +"// エラー!イミュータブルな変数に新しい値を代入することはできません。\n" #: src/variable_bindings/mut.md:23 msgid "The compiler will throw a detailed diagnostic about mutability errors." @@ -3222,7 +3345,9 @@ msgstr "コンパイラはミュータビリティに関するエラーの詳細 msgid "" "Variable bindings have a scope, and are constrained to live in a _block_. A " "block is a collection of statements enclosed by braces `{}`. " -msgstr "変数はスコープを持つため、 **ブロック** の中に閉じ込められています。ブロックとは`{}`で囲まれた領域のことです。" +msgstr "" +"変数はスコープを持つため、 **ブロック** の中に閉じ込められています。ブロック" +"とは`{}`で囲まれた領域のことです。" #: src/variable_bindings/scope.md:7 msgid "// This binding lives in the main function\n" @@ -3260,7 +3385,9 @@ msgstr "\"outer long: {}\"" msgid "" "Also, [variable shadowing](https://en.wikipedia.org/wiki/Variable_shadowing) " "is allowed." -msgstr "[変数のシャドーイング](https://en.wikipedia.org/wiki/Variable_shadowing)も可能です。" +msgstr "" +"[変数のシャドーイング](https://en.wikipedia.org/wiki/Variable_shadowing)も可" +"能です。" #: src/variable_bindings/scope.md:32 msgid "\"before being shadowed: {}\"" @@ -3296,8 +3423,8 @@ msgid "" "However, this form is seldom used, as it may lead to the use of " "uninitialized variables." msgstr "" -"変数の宣言だけを行っておき、初期化をのちに行うことも可能です。" -"しかし、最後まで初期化されない変数が生じる可能性があるため、ふつうは同時に行われます。" +"変数の宣言だけを行っておき、初期化をのちに行うことも可能です。しかし、最後ま" +"で初期化されない変数が生じる可能性があるため、ふつうは同時に行われます。" #: src/variable_bindings/declare.md:9 msgid "// Declare a variable binding\n" @@ -3323,13 +3450,18 @@ msgstr "\"another binding: {}\"" msgid "" "The compiler forbids use of uninitialized variables, as this would lead to " "undefined behavior." -msgstr "未初期化の変数があると予期せぬ動作をする場合があるため、コンパイラは変数を初期化してから使用するよう強制します。" +msgstr "" +"未初期化の変数があると予期せぬ動作をする場合があるため、コンパイラは変数を初" +"期化してから使用するよう強制します。" #: src/variable_bindings/freeze.md:3 msgid "" "When data is bound by the same name immutably, it also _freezes_. _Frozen_ " "data can't be modified until the immutable binding goes out of scope:" -msgstr "データを同じ名前のイミュータブルな変数に束縛しなおすと、データは*凍結*されます。*凍結*したデータは、イミュータブルな束縛がスコープ外になるまで変更できません。" +msgstr "" +"データを同じ名前のイミュータブルな変数に束縛しなおすと、データは*凍結*されま" +"す。*凍結*したデータは、イミュータブルな束縛がスコープ外になるまで変更できま" +"せん。" #: src/variable_bindings/freeze.md:11 msgid "// Shadowing by immutable `_mutable_integer`\n" @@ -3352,8 +3484,8 @@ msgid "" "Rust provides several mechanisms to change or define the type of primitive " "and user defined types. The following sections cover:" msgstr "" -"Rustには、基本データ型やユーザ定義型を定義したり変換したりする様々な方法があります。" -"この章は以下の内容を扱います。" +"Rustには、基本データ型やユーザ定義型を定義したり変換したりする様々な方法があ" +"ります。この章は以下の内容を扱います。" #: src/types.md:5 msgid "[Casting](types/cast.md) between primitive types" @@ -3377,8 +3509,9 @@ msgid "" "types. But, explicit type conversion (casting) can be performed using the " "`as` keyword." msgstr "" -"Rustは基本データ型について暗黙的な型変換(`coerction`)を行うことはありません。" -"しかし明示的な型変換(`casting`)は可能です。その場合`as`キーワードを使用します。" +"Rustは基本データ型について暗黙的な型変換(`coerction`)を行うことはありませ" +"ん。しかし明示的な型変換(`casting`)は可能です。その場合`as`キーワードを使用" +"します。" #: src/types/cast.md:6 msgid "" @@ -3386,8 +3519,8 @@ msgid "" "except in cases where C has undefined behavior. The behavior of all casts " "between integral types is well defined in Rust." msgstr "" -"整数型から整数型へ型変換する場合、C言語で可能なケースの場合はC言語と同じです。" -"C言語で未定義の場合の挙動も、Rustでは完全に定義されています。" +"整数型から整数型へ型変換する場合、C言語で可能なケースの場合はC言語と同じで" +"す。C言語で未定義の場合の挙動も、Rustでは完全に定義されています。" #: src/types/cast.md:11 msgid "// Suppress all warnings from casts which overflow.\n" @@ -3483,7 +3616,8 @@ msgstr "\" 128 as a i16 is: {}\"" msgid "" "// In boundary case 128 value in 8-bit two's complement representation is " "-128\n" -msgstr "// 境界値のケースを考えると、128の8ビットにおける2の補数は -128です。\n" +msgstr "" +"// 境界値のケースを考えると、128の8ビットにおける2の補数は -128です。\n" #: src/types/cast.md:57 msgid "\" 128 as a i8 is : {}\"" @@ -3549,7 +3683,8 @@ msgid "" " // return **unsound values**. Use these methods wisely:\n" msgstr "" "// この挙動は実行時にややコストがかかるため、安全でない方法で回避できます。\n" -" // ただし、結果はオーバーフローしたり *不正確な値* を返す場合があります。\n" +" // ただし、結果はオーバーフローしたり *不正確な値* を返す場合がありま" +"す。\n" " // この方法は賢く使いましょう。\n" #: src/types/cast.md:81 @@ -3566,8 +3701,8 @@ msgid "" "example, to specify that the literal `42` should have the type `i32`, write " "`42i32`." msgstr "" -"数値型リテラルはサフィックスにより型を指定することが可能です。" -"例えば、`42`というリテラルに対して`i32`型を指定するには`42i32`とします。" +"数値型リテラルはサフィックスにより型を指定することが可能です。例えば、`42`と" +"いうリテラルに対して`i32`型を指定するには`42i32`とします。" #: src/types/literals.md:6 msgid "" @@ -3575,8 +3710,9 @@ msgid "" "no constraint exists, the compiler will use `i32` for integers, and `f64` " "for floating-point numbers." msgstr "" -"サフィックスを指定しない数値型リテラルの場合、その型がどのように使用されるかに依存して決められます。" -"デフォルトでは整数型の場合`i32`が、浮動小数点数型には`f64`が使われます。" +"サフィックスを指定しない数値型リテラルの場合、その型がどのように使用されるか" +"に依存して決められます。デフォルトでは整数型の場合`i32`が、浮動小数点数型には" +"`f64`が使われます。" #: src/types/literals.md:12 msgid "// Suffixed literals, their types are known at initialization\n" @@ -3615,8 +3751,8 @@ msgid "" "There are some concepts used in the previous code that haven't been " "explained yet, here's a brief explanation for the impatient readers:" msgstr "" -"上のコードには現時点では解説していない考えがいくつか使用されています。" -"気になる方のために簡単に説明をしておきましょう。" +"上のコードには現時点では解説していない考えがいくつか使用されています。気にな" +"る方のために簡単に説明をしておきましょう。" #: src/types/literals.md:33 msgid "" @@ -3626,10 +3762,11 @@ msgid "" "is defined in the `std` _crate_. For more details, see [modules](../mod.md) " "and [crates](../crates.md)." msgstr "" -"`std::mem::size_of_val`は関数ですが、 *絶対パス* で呼び出されています。" -"ソースコードは論理的に区切られた *モジュール* と呼ばれるものにわけられることができます。" -"今回の場合は`size_of_val`関数は`mem`モジュール内で定義されており、`mem`モジュールは`std` *クレート* 内で定義されています。" -"より詳しくは[モジュール](../mod.md)と[クレート](../crates.md)を参照してください。" +"`std::mem::size_of_val`は関数ですが、 *絶対パス* で呼び出されています。ソース" +"コードは論理的に区切られた *モジュール* と呼ばれるものにわけられることができ" +"ます。今回の場合は`size_of_val`関数は`mem`モジュール内で定義されており、`mem`" +"モジュールは`std` *クレート* 内で定義されています。より詳しくは[モジュール]" +"(../mod.md)と[クレート](../crates.md)を参照してください。" #: src/types/inference.md:3 msgid "" @@ -3638,14 +3775,16 @@ msgid "" "the variable is used afterwards to infer its type. Here's an advanced " "example of type inference:" msgstr "" -"Rustの型推論エンジンはなかなか賢くできています。" -"初期化の際に評価値の型をチェックするだけでなく、その後にどのような使われ方をしているかを見て推論します。" -"以下がその例です。" +"Rustの型推論エンジンはなかなか賢くできています。初期化の際に評価値の型を" +"チェックするだけでなく、その後にどのような使われ方をしているかを見て推論しま" +"す。以下がその例です。" #: src/types/inference.md:10 msgid "" "// Because of the annotation, the compiler knows that `elem` has type u8.\n" -msgstr "// アノテーションのおかげで、コンパイラは`elem`がu8型であることがわかります。\n" +msgstr "" +"// アノテーションのおかげで、コンパイラは`elem`がu8型であることがわかりま" +"す。\n" #: src/types/inference.md:13 msgid "// Create an empty vector (a growable array).\n" @@ -3676,7 +3815,9 @@ msgstr "" msgid "" "No type annotation of variables was needed, the compiler is happy and so is " "the programmer!" -msgstr "このように、変数の型アノテーションは必要ありません。これでコンパイラもプログラマもハッピーですね!" +msgstr "" +"このように、変数の型アノテーションは必要ありません。これでコンパイラもプログ" +"ラマもハッピーですね!" #: src/types/alias.md:3 msgid "" @@ -3685,9 +3826,9 @@ msgid "" "warning. The exception to this rule are the primitive types: `usize`, `f32`, " "etc." msgstr "" -"`type`文を使用することで既存の型に新しい名前を付けることができます。" -"その場合、名前は`UpperCamelCase`でなくてはなりません。さもなくばコンパイラがエラーを出します。" -"唯一の例外は`usize`や`f32`のような基本データ型です。" +"`type`文を使用することで既存の型に新しい名前を付けることができます。その場" +"合、名前は`UpperCamelCase`でなくてはなりません。さもなくばコンパイラがエラー" +"を出します。唯一の例外は`usize`や`f32`のような基本データ型です。" #: src/types/alias.md:8 msgid "// `NanoSecond`, `Inch`, and `U64` are new names for `u64`.\n" @@ -3703,7 +3844,8 @@ msgid "" " // aliases are *not* new types\n" msgstr "" "// 型のエイリアスは、元の型をより型安全する **わけではない** ことに注意。\n" -" // なぜならば、エイリアスは新たな型を定義している **わけではない** からです。\n" +" // なぜならば、エイリアスは新たな型を定義している **わけではない** からで" +"す。\n" #: src/types/alias.md:20 msgid "\"{} nanoseconds + {} inches = {} unit?\"" @@ -3714,8 +3856,8 @@ msgid "" "The main use of aliases is to reduce boilerplate; for example the `io::" "Result` type is an alias for the `Result` type." msgstr "" -"このようにエイリアスを付ける一番の理由はボイラープレートを減らすことです。" -"例えば`io::Result`型は`Result`の別名です。" +"このようにエイリアスを付ける一番の理由はボイラープレートを減らすことです。例" +"えば`io::Result`型は`Result`の別名です。" #: src/types/alias.md:32 msgid "[Attributes](../attribute.md)" @@ -3736,10 +3878,11 @@ msgid "" "there are more specific ones for the more common cases, in particular when " "converting to and from `String`s." msgstr "" -"Rustはカスタム型(例えば`struct`や`enum`)間の変換を[トレイト](trait.md)を用いて行います。" -"ジェネリックな型変換には[`From`](https://doc.rust-lang.org/std/convert/trait.From.html)および" -"[`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html)トレイトを使用します。" -"しかし、よくあるケースにおいて、特に`String`との相互の型変換では、特殊なトレイトが使用されます。" +"Rustはカスタム型(例えば`struct`や`enum`)間の変換を[トレイト](trait.md)を用" +"いて行います。ジェネリックな型変換には[`From`](https://doc.rust-lang.org/std/" +"convert/trait.From.html)および[`Into`](https://doc.rust-lang.org/std/convert/" +"trait.Into.html)トレイトを使用します。しかし、よくあるケースにおいて、特に" +"`String`との相互の型変換では、特殊なトレイトが使用されます。" #: src/conversion/from_into.md:3 msgid "" @@ -3750,9 +3893,10 @@ msgid "" "that we should be able to convert type B to type A." msgstr "" "[`From`](https://doc.rust-lang.org/std/convert/trait.From.html)トレイトと" -"[`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html)トレイトは本質的に結びついており、" -"そのことが実際の実装に反映されています。" -"もし型Aが型Bからの型変換をサポートしているのであれば、型Bは型Aへの型変換ができると思うのが自然です。" +"[`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html)トレイトは本質" +"的に結びついており、そのことが実際の実装に反映されています。もし型Aが型Bから" +"の型変換をサポートしているのであれば、型Bは型Aへの型変換ができると思うのが自" +"然です。" #: src/conversion/from_into.md:7 msgid "`From`" @@ -3766,10 +3910,11 @@ msgid "" "There are numerous implementations of this trait within the standard library " "for conversion of primitive and common types." msgstr "" -"[`From`](https://doc.rust-lang.org/std/convert/trait.From.html)トレイトは、" -"ある型に対し、別の型からその型を作る方法を定義できるようにするものです。" -"そのため、複数の型の間で型変換を行うための非常にシンプルな仕組みを提供しています。" -"標準ライブラリでは、基本データ型やよく使われる型に対して、このトレイトが多数実装されています。" +"[`From`](https://doc.rust-lang.org/std/convert/trait.From.html)トレイトは、あ" +"る型に対し、別の型からその型を作る方法を定義できるようにするものです。そのた" +"め、複数の型の間で型変換を行うための非常にシンプルな仕組みを提供しています。" +"標準ライブラリでは、基本データ型やよく使われる型に対して、このトレイトが多数" +"実装されています。" #: src/conversion/from_into.md:14 msgid "For example we can easily convert a `str` into a `String`" @@ -3793,9 +3938,9 @@ msgid "" "simply the reciprocal of the `From` trait. That is, if you have implemented " "the `From` trait for your type, `Into` will call it when necessary." msgstr "" -"[`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html)トレイトは、" -"単に`From`トレイトの逆の働きをします。" -"もし自作の型に`From`トレイトが実装されていたら、`Into`は必要に応じてそれを呼び出します。" +"[`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html)トレイトは、単" +"に`From`トレイトの逆の働きをします。もし自作の型に`From`トレイトが実装されて" +"いたら、`Into`は必要に応じてそれを呼び出します。" #: src/conversion/from_into.md:49 msgid "" @@ -3804,9 +3949,9 @@ msgid "" "However this is a small trade-off considering we get the functionality for " "free." msgstr "" -"`Into`トレイトを使用すると、ほとんどの場合、コンパイラが型を決定することができないため、" -"変換する型を指定する必要があります。" -"しかし、この機能を無料で得られることを考えれば、これは小さなトレードオフです。" +"`Into`トレイトを使用すると、ほとんどの場合、コンパイラが型を決定することがで" +"きないため、変換する型を指定する必要があります。しかし、この機能を無料で得ら" +"れることを考えれば、これは小さなトレードオフです。" #: src/conversion/from_into.md:69 msgid "// Try removing the type annotation\n" @@ -3821,11 +3966,12 @@ msgid "" "for fallible conversions, and as such, return [`Result`](https://doc.rust-" "lang.org/std/result/enum.Result.html)s." msgstr "" -"[`From`と`Into`](from_into.html)と同様に、[`TryFrom`](https://doc.rust-lang.org/std/convert/trait.TryFrom.html)" -"と[`TryInto`](https://doc.rust-lang.org/std/convert/trait.TryInto.html)" -"も型変換を行うジェネリックなトレイトです。" -"`From`/`Into`と異なり、`TryFrom`/`TryInto`トレイトは失敗する可能性のある型変換に用いられるので、" -"[`Result`](https://doc.rust-lang.org/std/result/enum.Result.html)を返します。" +"[`From`と`Into`](from_into.html)と同様に、[`TryFrom`](https://doc.rust-lang." +"org/std/convert/trait.TryFrom.html)と[`TryInto`](https://doc.rust-lang.org/" +"std/convert/trait.TryInto.html)も型変換を行うジェネリックなトレイトです。" +"`From`/`Into`と異なり、`TryFrom`/`TryInto`トレイトは失敗する可能性のある型変" +"換に用いられるので、[`Result`](https://doc.rust-lang.org/std/result/enum." +"Result.html)を返します。" #: src/conversion/try_from_try_into.md:33 msgid "// TryFrom\n" @@ -3853,10 +3999,13 @@ msgid "" "trait.ToString.html) and also allows printing the type as discussed in the " "section on [`print!`](../hello/print.md)." msgstr "" -"任意の型を`String`に変換するのは簡単で、その型に[`ToString`](https://doc.rust-lang.org/std/string/trait.ToString.html)トレイトを実装するだけです。" -"これを直接実装するよりも、[`fmt::Display`](https://doc.rust-lang.org/std/fmt/trait.Display.html)トレイトを実装するのがよいでしょう。" -"そうすることで自動的に[`ToString`](https://doc.rust-lang.org/std/string/trait.ToString.html)が提供されるだけでなく、" -"[`print!`](../hello/print.md)の章で説明したように、その型を表示できるようにもなります。" +"任意の型を`String`に変換するのは簡単で、その型に[`ToString`](https://doc." +"rust-lang.org/std/string/trait.ToString.html)トレイトを実装するだけです。これ" +"を直接実装するよりも、[`fmt::Display`](https://doc.rust-lang.org/std/fmt/" +"trait.Display.html)トレイトを実装するのがよいでしょう。そうすることで自動的に" +"[`ToString`](https://doc.rust-lang.org/std/string/trait.ToString.html)が提供" +"されるだけでなく、[`print!`](../hello/print.md)の章で説明したように、その型を" +"表示できるようにもなります。" #: src/conversion/string.md:19 msgid "\"Circle of radius {}\"" @@ -3868,19 +4017,20 @@ msgstr "Stringの解析" #: src/conversion/string.md:31 msgid "" -"One of the more common types to convert a string into is a number. The " -"idiomatic approach to this is to use the [`parse`](https://doc.rust-lang.org/" -"std/primitive.str.html#method.parse) function and either to arrange for type " +"It's useful to convert strings into many types, but one of the more common " +"string operations is to convert them from string to number. The idiomatic " +"approach to this is to use the [`parse`](https://doc.rust-lang.org/std/" +"primitive.str.html#method.parse) function and either to arrange for type " "inference or to specify the type to parse using the 'turbofish' syntax. Both " "alternatives are shown in the following example." msgstr "" -"文字列からの型変換において、数値への型変換はよく行われるものの一つです。" -"これを行うイディオムは[`parse`](https://doc.rust-lang.org/std/primitive.str.html#method.parse)" -"関数を使用することですが、このときに型を推論できるようにするか、" -"もしくはターボフィッシュ構文(`::<>`)を使用して型を指定するかのいずれかを行います。" -"以下の例では、どちらの方法も紹介しています。" +"文字列からの型変換において、数値への型変換はよく行われるものの一つです。これ" +"を行うイディオムは[`parse`](https://doc.rust-lang.org/std/primitive.str." +"html#method.parse)関数を使用することですが、このときに型を推論できるようにす" +"るか、もしくはターボフィッシュ構文(`::<>`)を使用して型を指定するかのいずれ" +"かを行います。以下の例では、どちらの方法も紹介しています。" -#: src/conversion/string.md:36 +#: src/conversion/string.md:37 msgid "" "This will convert the string into the type specified as long as the " "[`FromStr`](https://doc.rust-lang.org/std/str/trait.FromStr.html) trait is " @@ -3889,17 +4039,17 @@ msgid "" "implement the [`FromStr`](https://doc.rust-lang.org/std/str/trait.FromStr." "html) trait for that type." msgstr "" -"`parse`関数は、指定された型に[`FromStr`](https://doc.rust-lang.org/std/str/trait.FromStr.html)" -"トレイトが実装されていれば、文字列をその型に変換します。" -"このトレイトは標準ライブラリの多くの型に対して実装されています。" -"ユーザー定義の型でこの機能を利用するには、その型に対して" -"[`FromStr`](https://doc.rust-lang.org/std/str/trait.FromStr.html)トレイトを実装するだけです。" +"`parse`関数は、指定された型に[`FromStr`](https://doc.rust-lang.org/std/str/" +"trait.FromStr.html)トレイトが実装されていれば、文字列をその型に変換します。こ" +"のトレイトは標準ライブラリの多くの型に対して実装されています。ユーザー定義の" +"型でこの機能を利用するには、その型に対して[`FromStr`](https://doc.rust-lang." +"org/std/str/trait.FromStr.html)トレイトを実装するだけです。" -#: src/conversion/string.md:43 src/std_misc/process/wait.md:10 +#: src/conversion/string.md:44 src/std_misc/process/wait.md:10 msgid "\"5\"" msgstr "\"5\"" -#: src/conversion/string.md:44 src/error/result.md:33 src/error/result.md:68 +#: src/conversion/string.md:45 src/error/result.md:33 src/error/result.md:68 #: src/error/result/result_map.md:42 src/error/result/result_map.md:75 #: src/error/result/result_alias.md:36 src/error/result/early_returns.md:36 #: src/error/result/enter_question_mark.md:34 @@ -3907,7 +4057,7 @@ msgstr "\"5\"" msgid "\"10\"" msgstr "\"10\"" -#: src/conversion/string.md:47 +#: src/conversion/string.md:48 msgid "\"Sum: {:?}\"" msgstr "\"Sum: {:?}\"" @@ -3947,9 +4097,10 @@ msgid "" "such as a local variable. However, if the last expression of the block ends " "with a semicolon, the return value will be `()`." msgstr "" -"コードブロックも式の一種です。よってブロックを丸ごと値として扱うことができます。" -"その場合ブロック内の最後の式が場所を表す式(例えばローカル変数)に代入されます。" -"ただし、ブロック内の最後の式が`;`で終わる場合は返り値は`()`になります。" +"コードブロックも式の一種です。よってブロックを丸ごと値として扱うことができま" +"す。その場合ブロック内の最後の式が場所を表す式(例えばローカル変数)に代入さ" +"れます。ただし、ブロック内の最後の式が`;`で終わる場合は返り値は`()`になりま" +"す。" #: src/expression.md:41 msgid "// This expression will be assigned to `y`\n" @@ -3977,8 +4128,8 @@ msgid "" "An integral part of any programming language are ways to modify control " "flow: `if`/`else`, `for`, and others. Let's talk about them in Rust." msgstr "" -"処理の流れをコントロールすることはあらゆるプログラミング言語において重要な要素です。" -"`if`/`else`、`for`等です。Rustの文法を見ていきましょう。" +"処理の流れをコントロールすることはあらゆるプログラミング言語において重要な要" +"素です。`if`/`else`、`for`等です。Rustの文法を見ていきましょう。" #: src/flow_control/if_else.md:3 msgid "" @@ -3987,9 +4138,10 @@ msgid "" "and each condition is followed by a block. `if`\\-`else` conditionals are " "expressions, and, all branches must return the same type." msgstr "" -"`if`\\-`else`を用いた条件分岐は他の言語に似ています。" -"多くの言語では条件式の中を括弧でくくる必要がありますが、Rustではその必要はありません。" -"条件式の直後にはブロックが続きます。`if`\\-`else`は式の一種で、いずれの分岐先でも返り値の型は同一でなくてはなりません。" +"`if`\\-`else`を用いた条件分岐は他の言語に似ています。多くの言語では条件式の中" +"を括弧でくくる必要がありますが、Rustではその必要はありません。条件式の直後に" +"はブロックが続きます。`if`\\-`else`は式の一種で、いずれの分岐先でも返り値の型" +"は同一でなくてはなりません。" #: src/flow_control/if_else.md:13 msgid "\"{} is negative\"" @@ -4036,14 +4188,18 @@ msgstr "\"{} -> {}\"" #: src/flow_control/loop.md:3 msgid "Rust provides a `loop` keyword to indicate an infinite loop." -msgstr "Rustには`loop`というキーワードが存在します。これは無限ループを作成するのに使用します。" +msgstr "" +"Rustには`loop`というキーワードが存在します。これは無限ループを作成するのに使" +"用します。" #: src/flow_control/loop.md:5 msgid "" "The `break` statement can be used to exit a loop at anytime, whereas the " "`continue` statement can be used to skip the rest of the iteration and start " "a new one." -msgstr "ループから抜けだす時は`break`、即座に次のループに移るときは`continue`が使用できます。" +msgstr "" +"ループから抜けだす時は`break`、即座に次のループに移るときは`continue`が使用で" +"きます。" #: src/flow_control/loop.md:13 msgid "\"Let's count until infinity!\"" @@ -4075,8 +4231,9 @@ msgid "" "loops. In these cases, the loops must be annotated with some `'label`, and " "the label must be passed to the `break`/`continue` statement." msgstr "" -"ネストしたループを回している時に外側のループを`break`または`continue`したい場合があります。" -"こういった場合には`'label`を用いてループにラベルを貼り、`break`/`continue`にそのラベルを渡します。" +"ネストしたループを回している時に外側のループを`break`または`continue`したい場" +"合があります。こういった場合には`'label`を用いてループにラベルを貼り、" +"`break`/`continue`にそのラベルを渡します。" #: src/flow_control/loop/nested.md:12 msgid "\"Entered the outer loop\"" @@ -4113,20 +4270,23 @@ msgid "" "of the code: put it after the `break`, and it will be returned by the `loop` " "expression." msgstr "" -"`loop`の用途のひとつに「成功するまである処理を再試行する」ことがあります。" -"もしその処理が値を返すならば、それをコードの他の部分に渡す必要があるでしょう。" +"`loop`の用途のひとつに「成功するまである処理を再試行する」ことがあります。も" +"しその処理が値を返すならば、それをコードの他の部分に渡す必要があるでしょう。" "`break`の後に値を置くと、それが`loop`式の値として返されます。" #: src/flow_control/while.md:3 msgid "" "The `while` keyword can be used to run a loop while a condition is true." -msgstr "`while`キーワードは条件が真である限り実行され続けるループのために使用します。" +msgstr "" +"`while`キーワードは条件が真である限り実行され続けるループのために使用します。" #: src/flow_control/while.md:5 msgid "" "Let's write the infamous [FizzBuzz](https://en.wikipedia.org/wiki/Fizz_buzz) " "using a `while` loop." -msgstr "悪名高い[FizzBuzz問題](https://en.wikipedia.org/wiki/Fizz_buzz)を`while`を用いて解いてみましょう。" +msgstr "" +"悪名高い[FizzBuzz問題](https://en.wikipedia.org/wiki/Fizz_buzz)を`while`を用" +"いて解いてみましょう。" #: src/flow_control/while.md:9 msgid "// A counter variable\n" @@ -4165,9 +4325,9 @@ msgid "" "the easiest ways to create an iterator is to use the range notation `a..b`. " "This yields values from `a` (inclusive) to `b` (exclusive) in steps of one." msgstr "" -"`for in`構文を用いることで、イテレータのそれぞれの要素に対して処理をすることが可能です。" -"イテレータを作る最も単純な方法は`a..b`のような範囲記法です。" -"これは「`a`」から「`b`のひとつ前」までの要素を順に生成します。" +"`for in`構文を用いることで、イテレータのそれぞれの要素に対して処理をすること" +"が可能です。イテレータを作る最も単純な方法は`a..b`のような範囲記法です。これ" +"は「`a`」から「`b`のひとつ前」までの要素を順に生成します。" #: src/flow_control/for.md:10 msgid "Let's write FizzBuzz using `for` instead of `while`." @@ -4181,7 +4341,9 @@ msgstr "// `n`は1, 2, ...., 100のそれぞれの値を取ります。\n" msgid "" "Alternatively, `a..=b` can be used for a range that is inclusive on both " "ends. The above can be written as:" -msgstr "上記の代わりに`a..=b`を用いると、両端の値を含む範囲を指定できます。上記の例は次のように書けます。" +msgstr "" +"上記の代わりに`a..=b`を用いると、両端の値を含む範囲を指定できます。上記の例は" +"次のように書けます。" #: src/flow_control/for.md:49 msgid "for and iterators" @@ -4195,10 +4357,10 @@ msgid "" "collection. However, this is not the only means of converting collections " "into iterators." msgstr "" -"`for in`構文はイテレータとさまざまな方法でやり取りできます。" -"[Iterator](../trait/iter.md)トレイトの章で説明したように、" -"デフォルトでは`for`ループにおいて`into_iter`関数がコレクションに対して適用されます。" -"しかし、コレクションをイテレータに変換する方法はこれだけではありません。" +"`for in`構文はイテレータとさまざまな方法でやり取りできます。[Iterator](../" +"trait/iter.md)トレイトの章で説明したように、デフォルトでは`for`ループにおいて" +"`into_iter`関数がコレクションに対して適用されます。しかし、コレクションをイテ" +"レータに変換する方法はこれだけではありません。" #: src/flow_control/for.md:56 msgid "" @@ -4206,16 +4368,16 @@ msgid "" "into an iterator in different ways, by providing different views on the data " "within." msgstr "" -"`into_iter`、`iter`、`iter_mut`はいずれもコレクションのイテレータへの変換を行いますが、" -"データの「見せ方」の違いにより、そのやり方はそれぞれ異なります。" +"`into_iter`、`iter`、`iter_mut`はいずれもコレクションのイテレータへの変換を行" +"いますが、データの「見せ方」の違いにより、そのやり方はそれぞれ異なります。" #: src/flow_control/for.md:60 msgid "" "`iter` - This borrows each element of the collection through each iteration. " "Thus leaving the collection untouched and available for reuse after the loop." msgstr "" -"`iter` - この関数は、各周回においてコレクションの要素を借用します。" -"よってコレクションには手を加えないので、ループの実行後もコレクションを再利用できます。" +"`iter` - この関数は、各周回においてコレクションの要素を借用します。よってコレ" +"クションには手を加えないので、ループの実行後もコレクションを再利用できます。" #: src/flow_control/for.md:65 src/flow_control/for.md:85 #: src/flow_control/for.md:104 @@ -4252,16 +4414,18 @@ msgid "" "exact data is provided. Once the collection has been consumed it is no " "longer available for reuse as it has been 'moved' within the loop." msgstr "" -"`into_iter` - この関数はコレクションからデータを取り出すので、" -"各周回において要素のデータそのものが提供されます。" -"データを取り出してしまうと、データはループ内に「移動」してしまうので、" -"ループ実行後にコレクションを再利用することはできません。" +"`into_iter` - この関数はコレクションからデータを取り出すので、各周回において" +"要素のデータそのものが提供されます。データを取り出してしまうと、データはルー" +"プ内に「移動」してしまうので、ループ実行後にコレクションを再利用することはで" +"きません。" #: src/flow_control/for.md:99 msgid "" "`iter_mut` - This mutably borrows each element of the collection, allowing " "for the collection to be modified in place." -msgstr "`iter_mut` - この関数はコレクションの各要素をミュータブル(変更可能)で借用するので、コレクションの要素をその場で変更できます。" +msgstr "" +"`iter_mut` - この関数はコレクションの各要素をミュータブル(変更可能)で借用す" +"るので、コレクションの要素をその場で変更できます。" #: src/flow_control/for.md:109 msgid "\"Hello\"" @@ -4273,9 +4437,9 @@ msgid "" "difference in the types of iteration. The difference in type then of course " "implies differing actions that are able to be performed." msgstr "" -"上記に示した3つのコードにおいて、`match`の選択肢の型の違いに注意してください。" -"ここがそれぞれの方法の違いを生む鍵になっています。" -"型が異なれば、当然ながらそれに対して行える処理も変わります。" +"上記に示した3つのコードにおいて、`match`の選択肢の型の違いに注意してくださ" +"い。ここがそれぞれの方法の違いを生む鍵になっています。型が異なれば、当然なが" +"らそれに対して行える処理も変わります。" #: src/flow_control/for.md:123 msgid "[Iterator](../trait/iter.md)" @@ -4287,8 +4451,9 @@ msgid "" "like a C `switch`. The first matching arm is evaluated and all possible " "values must be covered." msgstr "" -"Rustは`match`を用いて、C言語における`switch`のようなパターンマッチングを行うことができます。" -"マッチする最初のアームが評価され、取りうるすべての値はカバーされていなければなりません。" +"Rustは`match`を用いて、C言語における`switch`のようなパターンマッチングを行う" +"ことができます。マッチする最初のアームが評価され、取りうるすべての値はカバー" +"されていなければなりません。" #: src/flow_control/match.md:10 msgid "// TODO ^ Try different values for `number`\n" @@ -4336,7 +4501,8 @@ msgstr "\"Ain't special\"" #: src/flow_control/match.md:23 msgid "// TODO ^ Try commenting out this catch-all arm\n" -msgstr "// TODO ^ この全てをキャッチするアームをコメントアウトしてみましょう。\n" +msgstr "" +"// TODO ^ この全てをキャッチするアームをコメントアウトしてみましょう。\n" #: src/flow_control/match.md:27 msgid "// Match is an expression too\n" @@ -4432,7 +4598,8 @@ msgstr "タプル同様、配列とスライスも以下のようにデストラ #: src/flow_control/match/destructuring/destructure_slice.md:7 msgid "// Try changing the values in the array, or make it a slice!\n" -msgstr "// 配列中の値を変更してみましょう。または、スライスにしてみましょう。\n" +msgstr "" +"// 配列中の値を変更してみましょう。または、スライスにしてみましょう。\n" #: src/flow_control/match/destructuring/destructure_slice.md:11 msgid "" @@ -4496,7 +4663,8 @@ msgid "" "[Arrays and Slices](../../../primitives/array.md) and [Binding](../binding." "md) for `@` sigil" msgstr "" -"[配列とスライス](../../../primitives/array.md), @マークについては[束縛](../binding.md)" +"[配列とスライス](../../../primitives/array.md), @マークについては[束縛](../" +"binding.md)" #: src/flow_control/match/destructuring/destructure_enum.md:3 msgid "An `enum` is destructured similarly:" @@ -4506,7 +4674,8 @@ msgstr "列挙型も似たやり方でデストラクトすることができま msgid "" "// `allow` required to silence warnings because only\n" "// one variant is used.\n" -msgstr "// `allow`は値を一つだけ使用したことによる警告を抑えるために存在します。\n" +msgstr "" +"// `allow`は値を一つだけ使用したことによる警告を抑えるために存在します。\n" #: src/flow_control/match/destructuring/destructure_enum.md:10 msgid "// These 3 are specified solely by their name.\n" @@ -4579,7 +4748,9 @@ msgid "" "For pointers, a distinction needs to be made between destructuring and " "dereferencing as they are different concepts which are used differently from " "languages like C/C++." -msgstr "Rustのポインタは、C/C++のポインタとは異なる概念なので、デストラクトとデリファレンスを同じようなやり方で扱うことはできません。" +msgstr "" +"Rustのポインタは、C/C++のポインタとは異なる概念なので、デストラクトとデリファ" +"レンスを同じようなやり方で扱うことはできません。" #: src/flow_control/match/destructuring/destructure_pointers.md:7 msgid "Dereferencing uses `*`" @@ -4610,7 +4781,8 @@ msgstr "" " // に用いられた場合、以下の2つの値が比較されていることになります。\n" " // `&i32`\n" " // `&val`\n" -" // ^ よって`&`を落とせば、`i32`が`val`に代入されることがわかります。\n" +" // ^ よって`&`を落とせば、`i32`が`val`に代入されることがわかりま" +"す。\n" #: src/flow_control/match/destructuring/destructure_pointers.md:23 msgid "\"Got a value via destructuring: {:?}\"" @@ -4739,7 +4911,9 @@ msgstr "[構造体](../../../custom_types/structs.md)" #: src/flow_control/match/guard.md:3 msgid "A `match` _guard_ can be added to filter the arm." -msgstr "`match`内の条件文をフィルタリングするために、 *ガード* を使用することができます。" +msgstr "" +"`match`内の条件文をフィルタリングするために、 *ガード* を使用することができま" +"す。" #: src/flow_control/match/guard.md:14 msgid "// ^ TODO try different values for `temperature`\n" @@ -4770,7 +4944,8 @@ msgid "" "Note that the compiler won't take guard conditions into account when " "checking if all patterns are covered by the match expression." msgstr "" -"パターンが全てカバーされているかどうかを判断する際に、ガード条件は考慮されないことに注意してください。" +"パターンが全てカバーされているかどうかを判断する際に、ガード条件は考慮されな" +"いことに注意してください。" #: src/flow_control/match/guard.md:35 msgid "\"Zero\"" @@ -4800,8 +4975,9 @@ msgid "" "variable without re-binding. `match` provides the `@` sigil for binding " "values to names:" msgstr "" -"いくつかの変数をまとめてマッチ対象とした場合、そのうちの一つを分岐先で使用することはそのままでは不可能です。" -"`match`内では`@`マークを使用して変数を束縛することができます。" +"いくつかの変数をまとめてマッチ対象とした場合、そのうちの一つを分岐先で使用す" +"ることはそのままでは不可能です。`match`内では`@`マークを使用して変数を束縛す" +"ることができます。" #: src/flow_control/match/binding.md:8 msgid "// A function `age` which returns a `u32`.\n" @@ -4845,7 +5021,8 @@ msgstr "\"I'm an old person of age {:?}\"" msgid "" "You can also use binding to \"destructure\" `enum` variants, such as " "`Option`:" -msgstr "`Option`のような、列挙型の値をデストラクトするためにも、束縛を利用できます。" +msgstr "" +"`Option`のような、列挙型の値をデストラクトするためにも、束縛を利用できます。" #: src/flow_control/match/binding.md:38 msgid "" @@ -4874,16 +5051,18 @@ msgid "" "[`functions`](../../fn.md), [`enums`](../../custom_types/enum.md) and " "[`Option`](../../std/option.md)" msgstr "" -"[関数](../../fn.md), [列挙型](../../custom_types/enum.md), " -"[`Option`](../../std/option.md)" +"[関数](../../fn.md), [列挙型](../../custom_types/enum.md), [`Option`](../../" +"std/option.md)" #: src/flow_control/if_let.md:3 msgid "" "For some use cases, when matching enums, `match` is awkward. For example:" -msgstr "列挙型をマッチさせるとき、場合によっては`match`を使用すると不自然な書き方になってしまう場合があります。例えば" +msgstr "" +"列挙型をマッチさせるとき、場合によっては`match`を使用すると不自然な書き方に" +"なってしまう場合があります。例えば" #: src/flow_control/if_let.md:6 src/flow_control/while_let.md:7 -#: src/flow_control/while_let.md:34 +#: src/flow_control/while_let.md:35 msgid "// Make `optional` of type `Option`\n" msgstr "// `optional`という変数の型を`Option`に指定。\n" @@ -4911,7 +5090,9 @@ msgstr "" msgid "" "`if let` is cleaner for this use case and in addition allows various failure " "options to be specified:" -msgstr "この場合は`if let`を用いたほうが美しく、失敗時の処理も柔軟に行うことができます。" +msgstr "" +"この場合は`if let`を用いたほうが美しく、失敗時の処理も柔軟に行うことができま" +"す。" #: src/flow_control/if_let.md:27 msgid "// All have type `Option`\n" @@ -5022,9 +5203,9 @@ msgid "" "continue to work." msgstr "" "もう一つのメリットは`if let`がパラメータを持たない列挙型にも使えることです。" -"列挙型が`PartialEq`を実装または導出していなくても問題ありません。" -"その場合、列挙型のインスタンスは比較できないので`if Foo::Bar == a`はコンパイルエラーとなりますが、" -"`if let`は引き続き使えます。" +"列挙型が`PartialEq`を実装または導出していなくても問題ありません。その場合、列" +"挙型のインスタンスは比較できないので`if Foo::Bar == a`はコンパイルエラーとな" +"りますが、`if let`は引き続き使えます。" #: src/flow_control/if_let.md:104 msgid "Would you like a challenge? Fix the following example to use `if let`:" @@ -5047,8 +5228,8 @@ msgid "" "[`enum`](../custom_types/enum.md), [`Option`](../std/option.md), and the " "[RFC](https://github.com/rust-lang/rfcs/pull/160)" msgstr "" -"[列挙型](../custom_types/enum.md), [`Option`](../std/option.md), " -"[RFC](https://github.com/rust-lang/rfcs/pull/160)" +"[列挙型](../custom_types/enum.md), [`Option`](../std/option.md), [RFC]" +"(https://github.com/rust-lang/rfcs/pull/160)" #: src/flow_control/let_else.md:4 msgid "🛈 stable since: rust 1.65" @@ -5067,8 +5248,9 @@ msgid "" "surrounding scope like a normal `let`, or else diverge (e.g. `break`, " "`return`, `panic!`) when the pattern doesn't match." msgstr "" -"`let`\\-`else`を使うと反駁できるパターンにマッチさせつつ、通常の`let`のように変数束縛することができます。" -"マッチしなかった場合は(`break`、`return`、`panic!`のように)処理を分岐させます。" +"`let`\\-`else`を使うと反駁できるパターンにマッチさせつつ、通常の`let`のように" +"変数束縛することができます。マッチしなかった場合は(`break`、`return`、" +"`panic!`のように)処理を分岐させます。" #: src/flow_control/let_else.md:18 src/flow_control/let_else.md:41 #: src/std/str.md:41 @@ -5098,16 +5280,16 @@ msgid "" "these patterns with an unfortunate bit of repetition and an outer `let`:" msgstr "" "束縛した変数名のスコープが`match`や`if let`\\-`else`式との主な違いです。" -"`match`や`if let`\\-`else`でも似たようなことができますが、" -"残念ながらコードの繰り返しや追加の`let`が必要になってしまいます。" +"`match`や`if let`\\-`else`でも似たようなことができますが、残念ながらコードの" +"繰り返しや追加の`let`が必要になってしまいます。" #: src/flow_control/let_else.md:59 msgid "" "[option](../std/option.md), [match](./match.md), [if let](./if_let.md) and " "the [let-else RFC](https://rust-lang.github.io/rfcs/3137-let-else.html)." msgstr "" -"[Option](../std/option.md), [match](./match.md), [if let](./if_let.md), " -"[let-else RFC](https://rust-lang.github.io/rfcs/3137-let-else.html)." +"[Option](../std/option.md), [match](./match.md), [if let](./if_let.md), [let-" +"else RFC](https://rust-lang.github.io/rfcs/3137-let-else.html)." #: src/flow_control/while_let.md:3 msgid "" @@ -5123,13 +5305,14 @@ msgstr "// 変数の照合を繰り返し行います。\n" #: src/flow_control/while_let.md:13 msgid "// If `optional` destructures, evaluate the block.\n" -msgstr "// もし`optional`のデストラクトに成功した場合、値に応じて処理を分岐。\n" +msgstr "" +"// もし`optional`のデストラクトに成功した場合、値に応じて処理を分岐。\n" -#: src/flow_control/while_let.md:16 src/flow_control/while_let.md:41 +#: src/flow_control/while_let.md:16 src/flow_control/while_let.md:42 msgid "\"Greater than 9, quit!\"" msgstr "\"Greater than 9, quit!\"" -#: src/flow_control/while_let.md:19 src/flow_control/while_let.md:44 +#: src/flow_control/while_let.md:19 src/flow_control/while_let.md:45 msgid "\"`i` is `{:?}`. Try again.\"" msgstr "\"`i` is `{:?}`. Try again.\"" @@ -5149,35 +5332,37 @@ msgstr "// ^ どうしてこんな行を書く必要が?もっと良い方法 msgid "Using `while let` makes this sequence much nicer:" msgstr "`while let`を使ってすっきり書くことができます。" -#: src/flow_control/while_let.md:36 +#: src/flow_control/while_let.md:38 msgid "" "// This reads: \"while `let` destructures `optional` into\n" -"// `Some(i)`, evaluate the block (`{}`). Else `break`.\n" +" // `Some(i)`, evaluate the block (`{}`). Else `break`.\n" msgstr "" "// これは次のように読めます。「`let`が`optional`を`Some(i)`にデストラクト\n" -"// している間はブロック内(`{}`)を評価せよ。さもなくば`break`せよ。」\n" +" // している間はブロック内(`{}`)を評価せよ。さもなくば`break`せよ。」\n" -#: src/flow_control/while_let.md:47 +#: src/flow_control/while_let.md:48 msgid "" "// ^ Less rightward drift and doesn't require\n" -" // explicitly handling the failing case.\n" -msgstr "// ^ インデントが少なく、デストラクト失敗時の処理を追加する必要がありません。\n" +" // explicitly handling the failing case.\n" +msgstr "" +"// ^ インデントが少なく、デストラクト失敗時の処理を追加する必要がありませ" +"ん。\n" -#: src/flow_control/while_let.md:49 +#: src/flow_control/while_let.md:51 msgid "" "// ^ `if let` had additional optional `else`/`else if`\n" -"// clauses. `while let` does not have these.\n" +" // clauses. `while let` does not have these.\n" msgstr "" "// ^ `if let`の場合は`else`/`else if`句が一つ余分にありましたが、\n" -"// `while let`では必要ありません。\n" +" // `while let`では必要ありません。\n" -#: src/flow_control/while_let.md:56 +#: src/flow_control/while_let.md:58 msgid "" "[`enum`](../custom_types/enum.md), [`Option`](../std/option.md), and the " "[RFC](https://github.com/rust-lang/rfcs/pull/214)" msgstr "" -"[列挙型](../custom_types/enum.md), [`Option`](../std/option.md), " -"[RFC](https://github.com/rust-lang/rfcs/pull/214)" +"[列挙型](../custom_types/enum.md), [`Option`](../std/option.md), [RFC]" +"(https://github.com/rust-lang/rfcs/pull/214)" #: src/fn.md:3 msgid "" @@ -5185,8 +5370,9 @@ msgid "" "annotated, just like variables, and, if the function returns a value, the " "return type must be specified after an arrow `->`." msgstr "" -"関数は`fn`キーワードを用いて定義することができます。" -"引数は変数と同様に型を指定する必要があり、もし関数が値を返すならば`->`の後にその型も指定する必要があります。" +"関数は`fn`キーワードを用いて定義することができます。引数は変数と同様に型を指" +"定する必要があり、もし関数が値を返すならば`->`の後にその型も指定する必要があ" +"ります。" #: src/fn.md:7 msgid "" @@ -5194,9 +5380,8 @@ msgid "" "Alternatively, the `return` statement can be used to return a value earlier " "from within the function, even from inside loops or `if` statements." msgstr "" -"関数内の最後の式が返り値となります。" -"関数の途中で値を返したい場合は`return`文を使用します。" -"ループの最中や`if`文の中からも値を返すことができます。" +"関数内の最後の式が返り値となります。関数の途中で値を返したい場合は`return`文" +"を使用します。ループの最中や`if`文の中からも値を返すことができます。" #: src/fn.md:11 msgid "Let's rewrite FizzBuzz using functions!" @@ -5247,14 +5432,16 @@ msgid "" "are defined on a type generally, while methods are associated functions that " "are called on a particular instance of a type." msgstr "" -"関数には特定の型に紐づいたものがあります。これには関連関数とメソッドの2つの形式があります。" -"メソッドは特定のインスタンスに関連付けて呼ばれる関数であるのに対し、関連関数は型全体に対して定義される関数です。" +"関数には特定の型に紐づいたものがあります。これには関連関数とメソッドの2つの形" +"式があります。メソッドは特定のインスタンスに関連付けて呼ばれる関数であるのに" +"対し、関連関数は型全体に対して定義される関数です。" #: src/fn/methods.md:13 msgid "" "// Implementation block, all `Point` associated functions & methods go in " "here\n" -msgstr "// 実装のためのブロック。`Point`の持つ関連関数とメソッドを全て定義します。\n" +msgstr "" +"// 実装のためのブロック。`Point`の持つ関連関数とメソッドを全て定義します。\n" #: src/fn/methods.md:16 msgid "" @@ -5361,7 +5548,8 @@ msgstr "" #: src/fn/methods.md:107 msgid "// Okay! Mutable objects can call mutable methods\n" -msgstr "// OK!ミュータブルなオブジェクトはミュータブルなメソッドを呼び出せます。\n" +msgstr "" +"// OK!ミュータブルなオブジェクトはミュータブルなメソッドを呼び出せます。\n" #: src/fn/methods.md:114 msgid "" @@ -5378,8 +5566,8 @@ msgid "" "Closures are functions that can capture the enclosing environment. For " "example, a closure that captures the `x` variable:" msgstr "" -"Rustにおけるクロージャは、その外側の環境を捕捉した関数のことです。" -"例えば、次のコードは変数`x`を捕捉したクロージャです。" +"Rustにおけるクロージャは、その外側の環境を捕捉した関数のことです。例えば、次" +"のコードは変数`x`を捕捉したクロージャです。" #: src/fn/closures.md:10 msgid "" @@ -5388,9 +5576,9 @@ msgid "" "both input and return types _can_ be inferred and input variable names " "_must_ be specified." msgstr "" -"クロージャの構文や機能は、その場限りの用途で何かを作るのに便利です。" -"クロージャの呼び出しは関数の呼び出しと全く同じです。" -"しかし、入力の型と戻り値の型は推論させることができますが、入力変数の名前は必ず指定しなくてはなりません。" +"クロージャの構文や機能は、その場限りの用途で何かを作るのに便利です。クロー" +"ジャの呼び出しは関数の呼び出しと全く同じです。しかし、入力の型と戻り値の型は" +"推論させることができますが、入力変数の名前は必ず指定しなくてはなりません。" #: src/fn/closures.md:15 msgid "Other characteristics of closures include:" @@ -5404,7 +5592,9 @@ msgstr "入力変数を囲むのに、`()`の代わりに`||`を用います。" msgid "" "optional body delimitation (`{}`) for a single line expression (mandatory " "otherwise)." -msgstr "本体が単一の式の場合は、本体の区切り文字(`{}`)を省略できます。(それ以外の場合は必須です)" +msgstr "" +"本体が単一の式の場合は、本体の区切り文字(`{}`)を省略できます。(それ以外の" +"場合は必須です)" #: src/fn/closures.md:18 msgid "the ability to capture the outer environment variables." @@ -5431,7 +5621,8 @@ msgid "" " // are assigned to appropriately named variables.\n" msgstr "" "// クロージャは匿名なので、参照に束縛して使います。\n" -" // 型アノテーションは、通常の関数と同様の方法で行えますが、必須ではありません。\n" +" // 型アノテーションは、通常の関数と同様の方法で行えますが、必須ではありま" +"せん。\n" " // `{}`も必須ではありません。\n" " // このように定義した無名関数を適切な名前の変数に代入します。\n" @@ -5455,8 +5646,10 @@ msgid "" "closure_inferred(42i64));\n" " // TODO: uncomment the line above and see the compiler error.\n" msgstr "" -"// クロージャの型が一度推論されると、別の型にあらためて推論することはできません。\n" -" //println!(\"cannot reuse closure_inferred with another type: {}\", closure_inferred(42i64));\n" +"// クロージャの型が一度推論されると、別の型にあらためて推論することはできませ" +"ん。\n" +" //println!(\"cannot reuse closure_inferred with another type: {}\", " +"closure_inferred(42i64));\n" " // TODO: 上の行をアンコメントしてコンパイルエラーを見てみましょう。\n" #: src/fn/closures.md:43 @@ -5478,10 +5671,11 @@ msgid "" "flexibly adapt to the use case, sometimes moving and sometimes borrowing. " "Closures can capture variables:" msgstr "" -"クロージャはとてもフレキシブルに動作するように出来ています。" -"クロージャにおいて型アノテーションをする必要が無いのは前述の仕組みのためですが、" -"この仕組みのおかげでユースケースに応じて参照を取得したり値そのものを取得したりといった動作が可能になります。" -"クロージャは外側の環境にある要素を、以下の形で取得することができます。" +"クロージャはとてもフレキシブルに動作するように出来ています。クロージャにおい" +"て型アノテーションをする必要が無いのは前述の仕組みのためですが、この仕組みの" +"おかげでユースケースに応じて参照を取得したり値そのものを取得したりといった動" +"作が可能になります。クロージャは外側の環境にある要素を、以下の形で取得するこ" +"とができます。" #: src/fn/closures/capture.md:8 msgid "by reference: `&T`" @@ -5499,7 +5693,9 @@ msgstr "値そのもの:`T`" msgid "" "They preferentially capture variables by reference and only go lower when " "required." -msgstr "クロージャは出来る限り参照を取得しようとし、その他2つは必要なときのみ取得します。" +msgstr "" +"クロージャは出来る限り参照を取得しようとし、その他2つは必要なときのみ取得しま" +"す。" #: src/fn/closures/capture.md:19 msgid "\"green\"" @@ -5557,7 +5753,8 @@ msgid "" msgstr "" "// `count`をインクリメントするためのクロージャ。`count`と`&mut count`\n" " // の両方を取ることができますが、後者のほうが制限が少ないため、\n" -" // (訳注: `count`だと`&mut count`と違い、一度しか呼ぶことができない。)\n" +" // (訳注: `count`だと`&mut count`と違い、一度しか呼ぶことができな" +"い。)\n" " // そちらを取ります。直後に`count`を借用します。\n" " //\n" " // `inc`には`mut`をつける必要があります。なぜならミュータブルな型が\n" @@ -5579,7 +5776,8 @@ msgid "" " // let _reborrow = &count; \n" " // ^ TODO: try uncommenting this line.\n" msgstr "" -"// クロージャは後で呼ばれるため、まだ `count` をミュータブルで借用しています。\n" +"// クロージャは後で呼ばれるため、まだ `count` をミュータブルで借用していま" +"す。\n" " // 再借用しようとするとエラーになります。\n" " // let _reborrow = &count; \n" " // ^ TODO: この行のコメントアウトを解除しましょう。\n" @@ -5614,7 +5812,9 @@ msgstr "\"`movable`: {:?}\"" #: src/fn/closures/capture.md:79 msgid "// `consume` consumes the variable so this can only be called once.\n" -msgstr "// `consume`は変数を消費(開放)するため、一度しか呼び出すことができません。\n" +msgstr "" +"// `consume`は変数を消費(開放)するため、一度しか呼び出すことができませ" +"ん。\n" #: src/fn/closures/capture.md:81 msgid "" @@ -5628,7 +5828,9 @@ msgstr "" msgid "" "Using `move` before vertical pipes forces closure to take ownership of " "captured variables:" -msgstr "バーティカルパイプ(訳注:縦線記号`||`)の前に`move`を使用することで、キャプチャする変数の所有権を取ることをクロージャに強制します。" +msgstr "" +"バーティカルパイプ(訳注:縦線記号`||`)の前に`move`を使用することで、キャプ" +"チャする変数の所有権を取ることをクロージャに強制します。" #: src/fn/closures/capture.md:91 msgid "// `Vec` has non-copy semantics.\n" @@ -5643,7 +5845,8 @@ msgid "" msgstr "" "// println!(\"There're {} elements in vec\", haystack.len());\n" " // ^ 上の行のコメントアウトを解除すると、コンパイル時エラーになります。\n" -" // これは変数の所有権が移った後の再利用を借用チェッカーが許可しないからです。\n" +" // これは変数の所有権が移った後の再利用を借用チェッカーが許可しないからで" +"す。\n" #: src/fn/closures/capture.md:104 msgid "" @@ -5661,8 +5864,8 @@ msgid "" "[`Box`](../../std/box.md) and [`std::mem::drop`](https://doc.rust-lang.org/" "std/mem/fn.drop.html)" msgstr "" -"[`Box`](../../std/box.md), [`std::mem::drop`](https://doc.rust-lang.org/" -"std/mem/fn.drop.html)" +"[`Box`](../../std/box.md), [`std::mem::drop`](https://doc.rust-lang.org/std/" +"mem/fn.drop.html)" #: src/fn/closures/input_parameters.md:3 msgid "" @@ -5673,10 +5876,12 @@ msgid "" "closure does with captured value. In order of decreasing restriction, they " "are:" msgstr "" -"Rustはたいていの場合、型アノテーションなしでも変数を捕捉する方法を臨機応変に選択してくれますが、関数を書く場合にはこの曖昧さは許されません。" -"引数のパラメータとしてクロージャを取る場合、そのクロージャの完全な型はいくつかの`traits`の中の1つを使って明示されなければなりません。" -"どれが使われるかは、捕捉された値でクロージャが何をするかによって決まります。" -"制限の少ない順に並べると、下記の通りです。" +"Rustはたいていの場合、型アノテーションなしでも変数を捕捉する方法を臨機応変に" +"選択してくれますが、関数を書く場合にはこの曖昧さは許されません。引数のパラ" +"メータとしてクロージャを取る場合、そのクロージャの完全な型はいくつかの" +"`traits`の中の1つを使って明示されなければなりません。どれが使われるかは、捕捉" +"された値でクロージャが何をするかによって決まります。制限の少ない順に並べる" +"と、下記の通りです。" #: src/fn/closures/input_parameters.md:10 msgid "`Fn`: the closure uses the captured value by reference (`&T`)" @@ -5695,7 +5900,8 @@ msgstr "`FnOnce`:値(`T`)によって捕捉するクロージャ" msgid "" "On a variable-by-variable basis, the compiler will capture variables in the " "least restrictive manner possible." -msgstr "変数ごとに、コンパイラは可能な限り制約の少ない方法でその変数を捕捉します。" +msgstr "" +"変数ごとに、コンパイラは可能な限り制約の少ない方法でその変数を捕捉します。" #: src/fn/closures/input_parameters.md:17 msgid "" @@ -5704,10 +5910,10 @@ msgid "" "will ultimately choose based on how the captured variables are used in the " "closure." msgstr "" -"例えば、`FnOnce`というアノテーションの付けられたパラメータを考えてみましょう。" -"これはそのクロージャが`&T`、`&mut T`もしくは`T`の *どれか* で捕捉することを指定するものですが、" -"コンパイラは捕捉した変数がそのクロージャの中でどのように使用されるかに基づき、" -"最終的に捕捉する方法を選択することになります。" +"例えば、`FnOnce`というアノテーションの付けられたパラメータを考えてみましょ" +"う。これはそのクロージャが`&T`、`&mut T`もしくは`T`の *どれか* で捕捉すること" +"を指定するものですが、コンパイラは捕捉した変数がそのクロージャの中でどのよう" +"に使用されるかに基づき、最終的に捕捉する方法を選択することになります。" #: src/fn/closures/input_parameters.md:22 msgid "" @@ -5716,16 +5922,18 @@ msgid "" "annotated as `Fn`, then capturing variables by `&mut T` or `T` are not " "allowed. However, `&T` is allowed." msgstr "" -"これは、もし移動が可能であれば、いずれの種類の借用であっても同様に可能だからです。" -"その逆は正しくないことに注意してください。パラメータが`Fn`としてアノテーションされている場合、" -"変数を`&mut T`や`T`で捕捉することは許可されません。" +"これは、もし移動が可能であれば、いずれの種類の借用であっても同様に可能だから" +"です。その逆は正しくないことに注意してください。パラメータが`Fn`としてアノ" +"テーションされている場合、変数を`&mut T`や`T`で捕捉することは許可されません。" "しかし`&T`は許可されます。" #: src/fn/closures/input_parameters.md:27 msgid "" "In the following example, try swapping the usage of `Fn`, `FnMut`, and " "`FnOnce` to see what happens:" -msgstr "以下の例で、`Fn`、`FnMut`、および`FnOnce`を入れ替えて、何が起こるのかを見てみましょう。" +msgstr "" +"以下の例で、`Fn`、`FnMut`、および`FnOnce`を入れ替えて、何が起こるのかを見てみ" +"ましょう。" #: src/fn/closures/input_parameters.md:31 msgid "" @@ -5828,8 +6036,8 @@ msgstr "" "[`std::mem::drop`](https://doc.rust-lang.org/std/mem/fn.drop.html), [`Fn`]" "(https://doc.rust-lang.org/std/ops/trait.Fn.html), [`FnMut`](https://doc." "rust-lang.org/std/ops/trait.FnMut.html), [ジェネリクス](../../generics.md), " -"[where](../../generics/where.md), [`FnOnce`](https://doc.rust-lang.org/" -"std/ops/trait.FnOnce.html)" +"[where](../../generics/where.md), [`FnOnce`](https://doc.rust-lang.org/std/" +"ops/trait.FnOnce.html)" #: src/fn/closures/anonymity.md:3 msgid "" @@ -5838,8 +6046,9 @@ msgid "" "parameter requires [generics](../../generics.md), which is necessary because " "of how they are defined:" msgstr "" -"クロージャが周辺の環境から変数を取得するやり方は非常に明瞭です。何か注意すべき点はあるのでしょうか?" -"もちろんです。関数内でクロージャを使う場合、[ジェネリクス](../../generics.md)を使用する必要があります。詳しく見ていきましょう。" +"クロージャが周辺の環境から変数を取得するやり方は非常に明瞭です。何か注意すべ" +"き点はあるのでしょうか?もちろんです。関数内でクロージャを使う場合、[ジェネリ" +"クス](../../generics.md)を使用する必要があります。詳しく見ていきましょう。" #: src/fn/closures/anonymity.md:9 msgid "// `F` must be generic.\n" @@ -5853,10 +6062,10 @@ msgid "" "unknown type. This type is assigned to the variable which is stored until " "calling." msgstr "" -"クロージャが定義されると、コンパイラは裏側で、無名の構造体を作り、" -"そこにクロージャによって使用される外側の変数を入れます。" -"同時に`Fn`、`FnMut`、`FnOnce`という名のトレイトのいずれか一つを介して" -"この構造体に関数としての機能を実装し、実際に呼び出されるまで待ちます。" +"クロージャが定義されると、コンパイラは裏側で、無名の構造体を作り、そこにク" +"ロージャによって使用される外側の変数を入れます。同時に`Fn`、`FnMut`、`FnOnce`" +"という名のトレイトのいずれか一つを介してこの構造体に関数としての機能を実装" +"し、実際に呼び出されるまで待ちます。" #: src/fn/closures/anonymity.md:22 msgid "" @@ -5865,10 +6074,10 @@ msgid "" "ambiguous and not be allowed. Thus, bounding by one of the `traits`: `Fn`, " "`FnMut`, or `FnOnce` (which it implements) is sufficient to specify its type." msgstr "" -"この無名構造体は型が未指定なため、関数を実行する際にはジェネリクスが必要とされます。" -"とはいえ、``で指定するだけでは、まだ曖昧です。" -"(訳注:`&self`、`&mut self`、`self`のいずれをとるのかがわからないため)" -"そのため、`Fn`、`FnMut`、`FnOnce`のいずれか一つを実装することで対応しています。" +"この無名構造体は型が未指定なため、関数を実行する際にはジェネリクスが必要とさ" +"れます。とはいえ、``で指定するだけでは、まだ曖昧です。(訳注:`&self`、" +"`&mut self`、`self`のいずれをとるのかがわからないため)そのため、`Fn`、" +"`FnMut`、`FnOnce`のいずれか一つを実装することで対応しています。" #: src/fn/closures/anonymity.md:28 msgid "" @@ -5876,7 +6085,8 @@ msgid "" "// inputs and returns nothing - exactly what is required\n" "// for `print`.\n" msgstr "" -"// `F`は引数と戻り値を持たないクロージャ`Fn`を実装していなくてはなりません。\n" +"// `F`は引数と戻り値を持たないクロージャ`Fn`を実装していなくてはなりませ" +"ん。\n" "// これはまさに`print`に必要とされるものです。\n" #: src/fn/closures/anonymity.md:39 @@ -5895,10 +6105,10 @@ msgid "" "(https://doc.rust-lang.org/std/ops/trait.FnMut.html), and [`FnOnce`](https://" "doc.rust-lang.org/std/ops/trait.FnOnce.html)" msgstr "" -"[徹底解説](https://huonw.github.io/blog/2015/05/finding-closure-" -"in-rust/), [`Fn`](https://doc.rust-lang.org/std/ops/trait.Fn.html), [`FnMut`]" -"(https://doc.rust-lang.org/std/ops/trait.FnMut.html), [`FnOnce`](https://" -"doc.rust-lang.org/std/ops/trait.FnOnce.html)" +"[徹底解説](https://huonw.github.io/blog/2015/05/finding-closure-in-rust/), " +"[`Fn`](https://doc.rust-lang.org/std/ops/trait.Fn.html), [`FnMut`](https://" +"doc.rust-lang.org/std/ops/trait.FnMut.html), [`FnOnce`](https://doc.rust-" +"lang.org/std/ops/trait.FnOnce.html)" #: src/fn/closures/input_functions.md:3 msgid "" @@ -5907,10 +6117,11 @@ msgid "" "takes a closure as parameter, then any function that satisfies the trait " "bound of that closure can be passed as a parameter." msgstr "" -"これまで、クロージャを引数として渡せることを見てきました。すると次の疑問が浮かんできます。" -"「クロージャではない普通の関数を引数として渡すことは可能なのだろうか?」" -"可能です!もしパラメータとしてクロージャを取る関数を定義すれば、" -"そのクロージャのトレイト境界を満たす任意の関数をパラメータとして渡すことができます。" +"これまで、クロージャを引数として渡せることを見てきました。すると次の疑問が浮" +"かんできます。「クロージャではない普通の関数を引数として渡すことは可能なのだ" +"ろうか?」可能です!もしパラメータとしてクロージャを取る関数を定義すれば、そ" +"のクロージャのトレイト境界を満たす任意の関数をパラメータとして渡すことができ" +"ます。" #: src/fn/closures/input_functions.md:9 msgid "" @@ -5938,7 +6149,9 @@ msgstr "\"I'm a closure!\"" msgid "" "As an additional note, the `Fn`, `FnMut`, and `FnOnce` `traits` dictate how " "a closure captures variables from the enclosing scope." -msgstr "クロージャによる変数の捕捉がどのように行われているかを詳しく見たいときは`Fn`、`FnMut`、`FnOnce`を参照してください。" +msgstr "" +"クロージャによる変数の捕捉がどのように行われているかを詳しく見たいときは" +"`Fn`、`FnMut`、`FnOnce`を参照してください。" #: src/fn/closures/input_functions.md:34 msgid "" @@ -5956,10 +6169,9 @@ msgid "" "parameters should also be possible. However, anonymous closure types are, by " "definition, unknown, so we have to use `impl Trait` to return them." msgstr "" -"クロージャを引数のパラメータとして用いることができるのと同様に、" -"クロージャを戻り値として返すことも可能です。" -"しかし無名のクロージャの型はその定義上、不明であるため、" -"クロージャを返すためには`impl Trait`を使用する必要があります。" +"クロージャを引数のパラメータとして用いることができるのと同様に、クロージャを" +"戻り値として返すことも可能です。しかし無名のクロージャの型はその定義上、不明" +"であるため、クロージャを返すためには`impl Trait`を使用する必要があります。" #: src/fn/closures/output_parameters.md:8 msgid "The valid traits for returning a closure are:" @@ -5984,8 +6196,9 @@ msgid "" "would be dropped as soon as the function exited, leaving invalid references " "in the closure." msgstr "" -"更に、`move`というキーワードを使用し、全ての捕捉が値でおこなわれることを明示しなければなりません。" -"これは、関数を抜けると同時に参照による捕捉がドロップされ、無効な参照がクロージャに残ってしまうのを防ぐためです。" +"更に、`move`というキーワードを使用し、全ての捕捉が値でおこなわれることを明示" +"しなければなりません。これは、関数を抜けると同時に参照による捕捉がドロップさ" +"れ、無効な参照がクロージャに残ってしまうのを防ぐためです。" #: src/fn/closures/output_parameters.md:21 msgid "\"Fn\"" @@ -6012,14 +6225,15 @@ msgid "" "and [impl Trait](../../trait/impl_trait.md)." msgstr "" "[`Fn`](https://doc.rust-lang.org/std/ops/trait.Fn.html), [`FnMut`](https://" -"doc.rust-lang.org/std/ops/trait.FnMut.html), [ジェネリクス](../../generics.md), " -"[impl Trait](../../trait/impl_trait.md)." +"doc.rust-lang.org/std/ops/trait.FnMut.html), [ジェネリクス](../../generics." +"md), [impl Trait](../../trait/impl_trait.md)." #: src/fn/closures/closure_examples.md:3 msgid "" "This section contains a few examples of using closures from the `std` " "library." -msgstr "この節では`std`ライブラリを用いて、クロージャの利用例を幾つかお見せします。" +msgstr "" +"この節では`std`ライブラリを用いて、クロージャの利用例を幾つかお見せします。" #: src/fn/closures/closure_examples/iter_any.md:3 msgid "" @@ -6027,8 +6241,8 @@ msgid "" "`true` if any element satisfies the predicate. Otherwise `false`. Its " "signature:" msgstr "" -"`iterator::any`は、イテレータ内に一つでも条件を満たす要素があれば、" -"`true`を返し、さもなくば`false`を返すイテレータです。以下がそのシグネチャです" +"`iterator::any`は、イテレータ内に一つでも条件を満たす要素があれば、`true`を返" +"し、さもなくば`false`を返すイテレータです。以下がそのシグネチャです" #: src/fn/closures/closure_examples/iter_any.md:9 #: src/fn/closures/closure_examples/iter_find.md:9 @@ -6055,7 +6269,8 @@ msgstr "" #: src/fn/closures/closure_examples/iter_any.md:27 msgid "// `iter()` for vecs yields `&i32`. Destructure to `i32`.\n" -msgstr "// ベクタ型に対する`iter()`は`&i32`を生成するので、`i32`へとデストラクト。\n" +msgstr "" +"// ベクタ型に対する`iter()`は`&i32`を生成するので、`i32`へとデストラクト。\n" #: src/fn/closures/closure_examples/iter_any.md:28 msgid "\"2 in vec1: {}\"" @@ -6063,7 +6278,8 @@ msgstr "\"2 in vec1: {}\"" #: src/fn/closures/closure_examples/iter_any.md:29 msgid "// `into_iter()` for vecs yields `i32`. No destructuring required.\n" -msgstr "// `into_iter()`の場合は`i32`を生成するので、デストラクトは必要ありません。\n" +msgstr "" +"// `into_iter()`の場合は`i32`を生成するので、デストラクトは必要ありません。\n" #: src/fn/closures/closure_examples/iter_any.md:30 msgid "\"2 in vec2: {}\"" @@ -6072,7 +6288,8 @@ msgstr "\"2 in vec2: {}\"" #: src/fn/closures/closure_examples/iter_any.md:32 msgid "" "// `iter()` only borrows `vec1` and its elements, so they can be used again\n" -msgstr "// `iter()`は`vec1`とその要素を借用するだけなので、再び利用できます。\n" +msgstr "" +"// `iter()`は`vec1`とその要素を借用するだけなので、再び利用できます。\n" #: src/fn/closures/closure_examples/iter_any.md:33 msgid "\"vec1 len: {}\"" @@ -6125,8 +6342,9 @@ msgid "" "for the first value which satisfies some condition. If none of the values " "satisfy the condition, it returns `None`. Its signature:" msgstr "" -"`Iterator::find`はイテレータを辿る関数で、条件を満たす最初の値を探します。" -"もし条件を満たす値がなければ`None`を返します。型シグネチャは以下のようになります。" +"`Iterator::find`はイテレータを辿る関数で、条件を満たす最初の値を探します。も" +"し条件を満たす値がなければ`None`を返します。型シグネチャは以下のようになりま" +"す。" #: src/fn/closures/closure_examples/iter_find.md:12 msgid "" @@ -6199,8 +6417,8 @@ msgid "" "`Iterator::find` gives you a reference to the item. But if you want the " "_index_ of the item, use `Iterator::position`." msgstr "" -"`Iterator::find`は要素への参照を返します。" -"要素の _インデックス_ を使用したい場合、`Iterator::position`を使用してください。" +"`Iterator::find`は要素への参照を返します。要素の _インデックス_ を使用したい" +"場合、`Iterator::position`を使用してください。" #: src/fn/closures/closure_examples/iter_find.md:56 msgid "" @@ -6257,7 +6475,8 @@ msgid "" "Rust provides Higher Order Functions (HOF). These are functions that take " "one or more functions and/or produce a more useful function. HOFs and lazy " "iterators give Rust its functional flavor." -msgstr "Rustには高階関数(`Higher Order Functions, HOF`)を扱う機能が備わっています。" +msgstr "" +"Rustには高階関数(`Higher Order Functions, HOF`)を扱う機能が備わっています。" #: src/fn/hof.md:13 msgid "\"Find the sum of all the numbers with odd squares under 1000\"" @@ -6321,17 +6540,17 @@ msgid "" "[Iterator](https://doc.rust-lang.org/core/iter/trait.Iterator.html) " "implement their fair share of HOFs." msgstr "" -"[Option](https://doc.rust-lang.org/core/option/enum.Option.html) と " -"[イテレータ](https://doc.rust-lang.org/core/iter/trait.Iterator.html) " -"には高階関数が使用されています。" +"[Option](https://doc.rust-lang.org/core/option/enum.Option.html) と [イテレー" +"タ](https://doc.rust-lang.org/core/iter/trait.Iterator.html) には高階関数が使" +"用されています。" #: src/fn/diverging.md:3 msgid "" "Diverging functions never return. They are marked using `!`, which is an " "empty type." msgstr "" -"発散する関数は決してリターンしない関数です。" -"こうした関数は `!` を使って、空の型であることが示されます。" +"発散する関数は決してリターンしない関数です。こうした関数は `!` を使って、空の" +"型であることが示されます。" #: src/fn/diverging.md:7 src/fn/diverging.md:35 msgid "\"This call never returns.\"" @@ -6343,16 +6562,17 @@ msgid "" "the set of all possible values this type can have is empty. Note that, it is " "different from the `()` type, which has exactly one possible value." msgstr "" -"他の全ての型と異なり、この型はインスタンス化できません。" -"この型が持ちうる全ての値の集合は空です。" -"この型は`()`型とは異なることに注意してください。" -"`()`型は値をただ1つだけ持つ型です。" +"他の全ての型と異なり、この型はインスタンス化できません。この型が持ちうる全て" +"の値の集合は空です。この型は`()`型とは異なることに注意してください。`()`型は" +"値をただ1つだけ持つ型です。" #: src/fn/diverging.md:15 msgid "" "For example, this function returns as usual, although there is no " "information in the return value." -msgstr "例えば、この関数は通常どおりリターンしますが、戻り値には何の情報も含みません。" +msgstr "" +"例えば、この関数は通常どおりリターンしますが、戻り値には何の情報も含みませ" +"ん。" #: src/fn/diverging.md:25 msgid "\"This function returns and you can see this line.\"" @@ -6375,9 +6595,10 @@ msgid "" "any other one and therefore used at places where an exact type is required, " "for instance in `match` branches. This allows us to write code like this:" msgstr "" -"これは抽象的な概念に見えるかもしれませんが、実際のところはとても実用的で、便利なことも多いのです。" -"この型の主な利点は、他のどのような型にもキャストできることです。" -"そのため、例えば`match`の分岐の中のような正確な型が要求される場所でも使用できます。" +"これは抽象的な概念に見えるかもしれませんが、実際のところはとても実用的で、便" +"利なことも多いのです。この型の主な利点は、他のどのような型にもキャストできる" +"ことです。そのため、例えば`match`の分岐の中のような正確な型が要求される場所で" +"も使用できます。" #: src/fn/diverging.md:50 msgid "" @@ -6400,7 +6621,8 @@ msgid "" "expression.\n" msgstr "" "// 一方、\"continue\"式はu32をリターンしませんが、これでも問題ありません。\n" -" // 決してリターンしないため、このmatch式が要求する型に違反しないからです。\n" +" // 決してリターンしないため、このmatch式が要求する型に違反し" +"ないからです。\n" #: src/fn/diverging.md:64 msgid "\"Sum of odd numbers up to 9 (excluding): {}\"" @@ -6411,21 +6633,26 @@ msgid "" "It is also the return type of functions that loop forever (e.g. `loop {}`) " "like network servers or functions that terminate the process (e.g. `exit()`)." msgstr "" -"この型は、ネットワークサーバのような永遠にループする関数(例:`loop {}`)の戻り値の型や、" -"プロセスを終了させる関数(例:`exit()`)の戻り値の型としても使用されます。" +"この型は、ネットワークサーバのような永遠にループする関数(例:`loop {}`)の戻" +"り値の型や、プロセスを終了させる関数(例:`exit()`)の戻り値の型としても使用" +"されます。" #: src/mod.md:3 msgid "" "Rust provides a powerful module system that can be used to hierarchically " "split code in logical units (modules), and manage visibility (public/" "private) between them." -msgstr "Rustにはコードを階層的に分割し、お互いの機能を隠蔽・公開するための強力なモジュールシステムがあります。" +msgstr "" +"Rustにはコードを階層的に分割し、お互いの機能を隠蔽・公開するための強力なモ" +"ジュールシステムがあります。" #: src/mod.md:7 msgid "" "A module is a collection of items: functions, structs, traits, `impl` " "blocks, and even other modules." -msgstr "モジュールは関数、構造体、トレイト、`impl`ブロック、さらには他のモジュールなどの要素の集合です。" +msgstr "" +"モジュールは関数、構造体、トレイト、`impl`ブロック、さらには他のモジュールな" +"どの要素の集合です。" #: src/mod/visibility.md:3 msgid "" @@ -6433,9 +6660,9 @@ msgid "" "overridden with the `pub` modifier. Only the public items of a module can be " "accessed from outside the module scope." msgstr "" -"デフォルトでは、モジュール内の要素はプライベートですが、" -"これは`pub`で修飾することでパブリックな属性にすることができます。" -"パブリックな属性のみがモジュールの外のスコープからアクセスできます。" +"デフォルトでは、モジュール内の要素はプライベートですが、これは`pub`で修飾する" +"ことでパブリックな属性にすることができます。パブリックな属性のみがモジュール" +"の外のスコープからアクセスできます。" #: src/mod/visibility.md:8 msgid "// A module named `my_mod`\n" @@ -6497,7 +6724,8 @@ msgid "" "// Functions declared using `pub(self)` syntax are only visible within\n" " // the current module, which is the same as leaving them private\n" msgstr "" -"// `pub(self)`形式で宣言された関数は現在のモジュール内でのみアクセスできます。\n" +"// `pub(self)`形式で宣言された関数は現在のモジュール内でのみアクセスできま" +"す。\n" " // つまり、プライベートにするのと同じです。\n" #: src/mod/visibility.md:48 @@ -6508,7 +6736,8 @@ msgstr "\"called `my_mod::nested::public_function_in_nested()`\"" msgid "" "// Functions declared using `pub(super)` syntax are only visible within\n" " // the parent module\n" -msgstr "// `pub(super)`形式で宣言された関数は親モジュール内でのみアクセスできます。\n" +msgstr "" +"// `pub(super)`形式で宣言された関数は親モジュール内でのみアクセスできます。\n" #: src/mod/visibility.md:54 msgid "\"called `my_mod::nested::public_function_in_super_mod()`\"" @@ -6543,7 +6772,8 @@ msgid "" "// Private parent items will still restrict the visibility of a child item,\n" " // even if it is declared as visible within a bigger scope.\n" msgstr "" -"// 親がプライベートな場合、子要素がより大きなスコープでアクセスできるように宣言されていても、\n" +"// 親がプライベートな場合、子要素がより大きなスコープでアクセスできるように宣" +"言されていても、\n" " // 子要素にアクセス可能な範囲は制限されます。\n" #: src/mod/visibility.md:81 @@ -6570,7 +6800,8 @@ msgstr "" #: src/mod/visibility.md:101 msgid "// pub(crate) items can be called from anywhere in the same crate\n" -msgstr "// pub(crate)の要素は同じクレートのどこからでも呼び出すことができます。\n" +msgstr "" +"// pub(crate)の要素は同じクレートのどこからでも呼び出すことができます。\n" #: src/mod/visibility.md:104 msgid "" @@ -6639,19 +6870,21 @@ msgid "" "visibility only matters when a struct is accessed from outside the module " "where it is defined, and has the goal of hiding information (encapsulation)." msgstr "" -"構造体はそれ自身に加え、フィールドごとにもパブリック・プライベートを設定することができます。" -"デフォルトではプライベートですが、`pub`宣言をすることで、" -"フィールドをパブリックにすることができます。" -"これは、構造体がモジュールの外から参照される時に限り意味のあるもので、" -"情報の隠蔽(カプセル化)を達成するための機能です。" +"構造体はそれ自身に加え、フィールドごとにもパブリック・プライベートを設定する" +"ことができます。デフォルトではプライベートですが、`pub`宣言をすることで、" +"フィールドをパブリックにすることができます。これは、構造体がモジュールの外か" +"ら参照される時に限り意味のあるもので、情報の隠蔽(カプセル化)を達成するため" +"の機能です。" #: src/mod/struct_visibility.md:10 msgid "// A public struct with a public field of generic type `T`\n" -msgstr "// パブリックなフィールド`T`(ジェネリック型)を持つパブリックな構造体\n" +msgstr "" +"// パブリックなフィールド`T`(ジェネリック型)を持つパブリックな構造体\n" #: src/mod/struct_visibility.md:15 msgid "// A public struct with a private field of generic type `T`\n" -msgstr "// プライベートなフィールド`T`(ジェネリック型)を持つパブリックな構造体\n" +msgstr "" +"// プライベートなフィールド`T`(ジェネリック型)を持つパブリックな構造体\n" #: src/mod/struct_visibility.md:21 msgid "// A public constructor method\n" @@ -6724,12 +6957,13 @@ msgid "" "The `use` declaration can be used to bind a full path to a new name, for " "easier access. It is often used like this:" msgstr "" -"`use`宣言をすることで、要素の絶対パスを新しい名前に束縛することができ、" -"より簡潔な記述が可能になります。例えば以下のように使えます。" +"`use`宣言をすることで、要素の絶対パスを新しい名前に束縛することができ、より簡" +"潔な記述が可能になります。例えば以下のように使えます。" #: src/mod/use.md:18 msgid "You can use the `as` keyword to bind imports to a different name:" -msgstr "`as`キーワードを使用することで、インポートを別名に束縛することができます。" +msgstr "" +"`as`キーワードを使用することで、インポートを別名に束縛することができます。" #: src/mod/use.md:21 msgid "// Bind the `deeply::nested::function` path to `other_function`.\n" @@ -6761,7 +6995,8 @@ msgid "" " // shadowing of `function()` is only in this block.\n" msgstr "" "// `use`束縛は局所的なスコープを持ちます。\n" -" // この場合には`function()`のシャドーイングはこのブロック内のみとなります。\n" +" // この場合には`function()`のシャドーイングはこのブロック内のみとなり" +"ます。\n" #: src/mod/use.md:50 msgid "\"Leaving block\"" @@ -6772,8 +7007,8 @@ msgid "" "The `super` and `self` keywords can be used in the path to remove ambiguity " "when accessing items and to prevent unnecessary hardcoding of paths." msgstr "" -"`super`及び`self`キーワードは、要素にアクセスする際に、" -"曖昧さをなくし、不必要なハードコーディングを避けるために使用できます。" +"`super`及び`self`キーワードは、要素にアクセスする際に、曖昧さをなくし、不必要" +"なハードコーディングを避けるために使用できます。" #: src/mod/super.md:13 msgid "\"called `cool::function()`\"" @@ -6789,7 +7024,8 @@ msgstr "\"called `my::cool::function()`\"" #: src/mod/super.md:29 msgid "// Let's access all the functions named `function` from this scope!\n" -msgstr "// `function`という名の様々な関数をこのスコープ内から参照してみましょう。\n" +msgstr "" +"// `function`という名の様々な関数をこのスコープ内から参照してみましょう。\n" #: src/mod/super.md:30 msgid "\"called `my::indirect_call()`, that\\n> \"" @@ -6832,8 +7068,8 @@ msgid "" "Modules can be mapped to a file/directory hierarchy. Let's break down the " "[visibility example](visibility.md) in files:" msgstr "" -"モジュールはファイル・ディレクトリの階層構造と対応関係にあります。" -"以下の様なファイルで[可視性の例](visibility.md)を詳しく見ていきましょう。" +"モジュールはファイル・ディレクトリの階層構造と対応関係にあります。以下の様な" +"ファイルで[可視性の例](visibility.md)を詳しく見ていきましょう。" #: src/mod/split.md:16 msgid "In `split.rs`:" @@ -6845,7 +7081,8 @@ msgid "" "// insert its contents inside a module named `my` under this scope\n" msgstr "" "// このように宣言すると、`my.rs`という名のファイルを探し、\n" -"// その内容をこのファイル中で`my`という名から使用することができるようにします。\n" +"// その内容をこのファイル中で`my`という名から使用することができるようにしま" +"す。\n" #: src/mod/split.md:39 msgid "In `my.rs`:" @@ -6858,7 +7095,8 @@ msgid "" "// and `inaccessible.rs` files and insert them here under their respective\n" "// modules\n" msgstr "" -"// 同様に`mod inaccessible`、`mod nested`によって、`nested.rs`、`inaccessible.rs`\n" +"// 同様に`mod inaccessible`、`mod nested`によって、`nested.rs`、" +"`inaccessible.rs`\n" "// の内容をこの中で使用することができるようになります。\n" "// 訳注:`pub`をつけないかぎり、この中でしか使用できません。\n" @@ -6903,12 +7141,12 @@ msgid "" "_before_ running the compiler over it. In other words, modules do _not_ get " "compiled individually, only crates get compiled." msgstr "" -"クレートはRustにおけるコンパイルの単位です。" -"`rustc some_file.rs`が呼ばれると、`some_file.rs`は必ず *クレートファイル* として扱われます。" -"もし`some_file.rs`が`mod`宣言を含んでいるのならば、コンパイルの *前に* 、" -"そのモジュールファイルの中身が`mod`の位置に挿入されます。" -"言い換えると、それぞれのモジュールが独立にコンパイルされるということはありませんが、" -"それぞれのクレートは互いに独立にコンパイルされるということです。" +"クレートはRustにおけるコンパイルの単位です。`rustc some_file.rs`が呼ばれる" +"と、`some_file.rs`は必ず *クレートファイル* として扱われます。もし`some_file." +"rs`が`mod`宣言を含んでいるのならば、コンパイルの *前に* 、そのモジュールファ" +"イルの中身が`mod`の位置に挿入されます。言い換えると、それぞれのモジュールが独" +"立にコンパイルされるということはありませんが、それぞれのクレートは互いに独立" +"にコンパイルされるということです。" #: src/crates.md:10 msgid "" @@ -6916,13 +7154,15 @@ msgid "" "will produce a binary from a crate. This behavior can be overridden by " "passing the `--crate-type` flag to `lib`." msgstr "" -"クレートはバイナリあるいはライブラリ形式でコンパイルされることが可能です。" -"デフォルトでは`rustc`はクレートからバイナリを作り出しますが、" -"この振る舞いは`--crate-type`フラグに`lib`を渡すことでオーバーライドできます。" +"クレートはバイナリあるいはライブラリ形式でコンパイルされることが可能です。デ" +"フォルトでは`rustc`はクレートからバイナリを作り出しますが、この振る舞いは`--" +"crate-type`フラグに`lib`を渡すことでオーバーライドできます。" #: src/crates/lib.md:3 msgid "Let's create a library, and then see how to link it to another crate." -msgstr "ではライブラリを作成し、それを別のクレートにリンクする方法を見ていきましょう。" +msgstr "" +"ではライブラリを作成し、それを別のクレートにリンクする方法を見ていきましょ" +"う。" #: src/crates/lib.md:5 msgid "In `rary.rs`:" @@ -6947,8 +7187,10 @@ msgid "" "crate-name` option to `rustc` or by using the [`crate_name` attribute](../" "attribute/crate.md)." msgstr "" -"ライブラリは「lib」が頭につき、デフォルトでは、その後ろに元となったクレートファイル名をつけます。" -"(訳注: ここでは`lib` + `rary`)この振る舞いは[`crate_name`アトリビュート](../attribute/crate.md)を用いてオーバーライドできます。" +"ライブラリは「lib」が頭につき、デフォルトでは、その後ろに元となったクレート" +"ファイル名をつけます。(訳注: ここでは`lib` + `rary`)この振る舞いは" +"[`crate_name`アトリビュート](../attribute/crate.md)を用いてオーバーライドでき" +"ます。" #: src/crates/using_lib.md:3 msgid "" @@ -6956,15 +7198,14 @@ msgid "" "All of its items will then be imported under a module named the same as the " "library. This module generally behaves the same way as any other module." msgstr "" -"クレートをこの新しいライブラリにリンクするには、`rustc`の`--extern`フラグを利用します。" -"クレートの要素を全てライブラリと同じ名前のモジュールにインポートします。" -"一般に、このモジュールは他のモジュールと同じように振る舞います。" +"クレートをこの新しいライブラリにリンクするには、`rustc`の`--extern`フラグを利" +"用します。クレートの要素を全てライブラリと同じ名前のモジュールにインポートし" +"ます。一般に、このモジュールは他のモジュールと同じように振る舞います。" #: src/crates/using_lib.md:8 msgid "" "// extern crate rary; // May be required for Rust 2015 edition or earlier\n" -msgstr "" -"// extern crate rary; // Rust 2015以前で必要。\n" +msgstr "// extern crate rary; // Rust 2015以前で必要。\n" #: src/crates/using_lib.md:13 msgid "" @@ -6979,14 +7220,16 @@ msgid "" "`cargo` is the official Rust package management tool. It has lots of really " "useful features to improve code quality and developer velocity! These include" msgstr "" -"`cargo`はRustの公式パッケージ管理ツールです。" -"とても便利な機能が多くあり、コードの品質や開発速度の向上に役立ちます。以下はその例です。" +"`cargo`はRustの公式パッケージ管理ツールです。とても便利な機能が多くあり、コー" +"ドの品質や開発速度の向上に役立ちます。以下はその例です。" #: src/cargo.md:6 msgid "" "Dependency management and integration with [crates.io](https://crates.io) " "(the official Rust package registry)" -msgstr "依存関係の管理と[crates.io](https://crates.io)(Rustの公式パッケージレジストリ)との統合" +msgstr "" +"依存関係の管理と[crates.io](https://crates.io)(Rustの公式パッケージレジスト" +"リ)との統合" #: src/cargo.md:8 msgid "Awareness of unit tests" @@ -7001,8 +7244,8 @@ msgid "" "This chapter will go through some quick basics, but you can find the " "comprehensive docs in [The Cargo Book](https://doc.rust-lang.org/cargo/)." msgstr "" -"この章では、簡単な基本機能を説明します。" -"包括的なドキュメントは[The Cargo Book](https://doc.rust-lang.org/cargo/)を参照してください。" +"この章では、簡単な基本機能を説明します。包括的なドキュメントは[The Cargo " +"Book](https://doc.rust-lang.org/cargo/)を参照してください。" #: src/cargo/deps.md:3 msgid "" @@ -7011,10 +7254,10 @@ msgid "" "Rust ecosystem comes standard with `cargo`! `cargo` can manage dependencies " "for a project." msgstr "" -"ほとんどのプログラムはライブラリに依存関係を持ちます。" -"もし依存関係を手動で管理したことがあれば、それがどれだけ苦痛であるか分かるでしょう。" -"幸運なことに、Rustのエコシステムには`cargo`が標準装備されています!" -"`cargo`によってプロジェクトの依存関係を管理することができます。" +"ほとんどのプログラムはライブラリに依存関係を持ちます。もし依存関係を手動で管" +"理したことがあれば、それがどれだけ苦痛であるか分かるでしょう。幸運なことに、" +"Rustのエコシステムには`cargo`が標準装備されています!`cargo`によってプロジェ" +"クトの依存関係を管理することができます。" #: src/cargo/deps.md:8 msgid "To create a new Rust project," @@ -7032,7 +7275,9 @@ msgstr "# ライブラリ\n" msgid "" "For the rest of this chapter, let's assume we are making a binary, rather " "than a library, but all of the concepts are the same." -msgstr "この章の残りでは、ライブラリではなくバイナリを作ることを想定しますが、コンセプトはすべて同じです。" +msgstr "" +"この章の残りでは、ライブラリではなくバイナリを作ることを想定しますが、コンセ" +"プトはすべて同じです。" #: src/cargo/deps.md:21 msgid "After the above commands, you should see a file hierarchy like this:" @@ -7044,9 +7289,21 @@ msgid "" "new there. The `Cargo.toml` is the config file for `cargo` for this project. " "If you look inside it, you should see something like this:" msgstr "" -"`main.rs`がこの新規プロジェクト `foo` のルートのソースファイルです。" -"なにも新しいことはありませんね。`Cargo.toml`はこのプロジェクトの`cargo`の設定ファイルです。" -"中を見てみるとこのようになっています。" +"`main.rs`がこの新規プロジェクト `foo` のルートのソースファイルです。なにも新" +"しいことはありませんね。`Cargo.toml`はこのプロジェクトの`cargo`の設定ファイル" +"です。中を見てみるとこのようになっています。" + +#: src/cargo/deps.md:39 +msgid "" +"```toml\n" +"[package]\n" +"name = \"foo\"\n" +"version = \"0.1.0\"\n" +"authors = [\"mark\"]\n" +"\n" +"[dependencies]\n" +"```" +msgstr "" #: src/cargo/deps.md:48 msgid "" @@ -7054,22 +7311,23 @@ msgid "" "is used by `crates.io` if you publish the crate (more later). It is also the " "name of the output binary when you compile." msgstr "" -"`[package]`の下の`name`フィールドがプロジェクトの名前を決定します。" -"これはクレートを公開するときに`crates.io`によって使われます(詳細は後述)。" -"またコンパイルしたときの出力ファイルの名前でもあります。" +"`[package]`の下の`name`フィールドがプロジェクトの名前を決定します。これはク" +"レートを公開するときに`crates.io`によって使われます(詳細は後述)。またコンパ" +"イルしたときの出力ファイルの名前でもあります。" #: src/cargo/deps.md:52 msgid "" "The `version` field is a crate version number using [Semantic Versioning]" "(http://semver.org/)." msgstr "" -"`version`フィールドはクレートのバージョン番号で、" -"[セマンティックバージョニング](http://semver.org/)を使っています。" +"`version`フィールドはクレートのバージョン番号で、[セマンティックバージョニン" +"グ](http://semver.org/)を使っています。" #: src/cargo/deps.md:55 msgid "" "The `authors` field is a list of authors used when publishing the crate." -msgstr "`authors`フィールドは作者のリストで、クレートを公開するときに使われます。" +msgstr "" +"`authors`フィールドは作者のリストで、クレートを公開するときに使われます。" #: src/cargo/deps.md:57 msgid "" @@ -7086,12 +7344,13 @@ msgid "" "the following to our `Cargo.toml` under `[dependencies]`: `clap = " "\"2.27.1\"`. And that's it! You can start using `clap` in your program." msgstr "" -"例えば、プログラムに素晴らしいCLIが欲しいとします。" -"[crates.io](https://crates.io)(Rustの公式パッケージレジストリ)には素晴らしいパッケージがたくさんあります。" -"よくある選択肢の1つは[clap](https://crates.io/crates/clap)です。" -"この記事を書いている時点での`clap`の最新の公開バージョンは`2.27.1`です。" -"依存関係をプログラムに追加するには、`Cargo.toml`の`[dependencies]`の下に`clap = \"2.27.1\"`と単に書き加えます。" -"これだけです!`clap`をプログラム内で使用できます。" +"例えば、プログラムに素晴らしいCLIが欲しいとします。[crates.io](https://" +"crates.io)(Rustの公式パッケージレジストリ)には素晴らしいパッケージがたくさ" +"んあります。よくある選択肢の1つは[clap](https://crates.io/crates/clap)です。" +"この記事を書いている時点での`clap`の最新の公開バージョンは`2.27.1`です。依存" +"関係をプログラムに追加するには、`Cargo.toml`の`[dependencies]`の下に`clap = " +"\"2.27.1\"`と単に書き加えます。これだけです!`clap`をプログラム内で使用できま" +"す。" #: src/cargo/deps.md:67 msgid "" @@ -7099,8 +7358,24 @@ msgid "" "org/cargo/reference/specifying-dependencies.html). Here is just a small " "sampling:" msgstr "" -"`cargo`は[他の形式の依存関係](https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html)" -"もサポートしています。その一部を示します。" +"`cargo`は[他の形式の依存関係](https://doc.rust-lang.org/cargo/reference/" +"specifying-dependencies.html)もサポートしています。その一部を示します。" + +#: src/cargo/deps.md:70 +msgid "" +"```toml\n" +"[package]\n" +"name = \"foo\"\n" +"version = \"0.1.0\"\n" +"authors = [\"mark\"]\n" +"\n" +"[dependencies]\n" +"clap = \"2.27.1\" # from crates.io\n" +"rand = { git = \"https://github.com/rust-lang-nursery/rand\" } # from online " +"repo\n" +"bar = { path = \"../bar\" } # from a path in the local filesystem\n" +"```" +msgstr "" #: src/cargo/deps.md:82 msgid "" @@ -7108,9 +7383,9 @@ msgid "" "configuration options are listed in the [format specification](https://doc." "rust-lang.org/cargo/reference/manifest.html) of `Cargo.toml`." msgstr "" -"`cargo`は依存管理ツール以上のこともできます。" -"`Cargo.toml`の[format specification](https://doc.rust-lang.org/cargo/reference/manifest.html)" -"に全ての設定オプションがリストアップされています。" +"`cargo`は依存管理ツール以上のこともできます。`Cargo.toml`の[format " +"specification](https://doc.rust-lang.org/cargo/reference/manifest.html)に全て" +"の設定オプションがリストアップされています。" #: src/cargo/deps.md:86 msgid "" @@ -7120,11 +7395,11 @@ msgid "" "crates if needed, and build everything, including your crate. (Note that it " "only rebuilds what it has not already built, similar to `make`)." msgstr "" -"プロジェクトをビルドするには、プロジェクトディレクトリのどこか(サブディレクトでも!)で`cargo build`を実行します。" -"また`cargo run`でビルドと実行をできます。" -"これらのコマンドは、全ての依存関係の解決、必要なクレートのダウンロード、" -"自分のクレートを含む全てのビルドを行うことに注意してください。" -"(`make`と同様、まだビルドしていないものだけをビルドします。)" +"プロジェクトをビルドするには、プロジェクトディレクトリのどこか(サブディレク" +"トでも!)で`cargo build`を実行します。また`cargo run`でビルドと実行をできま" +"す。これらのコマンドは、全ての依存関係の解決、必要なクレートのダウンロード、" +"自分のクレートを含む全てのビルドを行うことに注意してください。(`make`と同" +"様、まだビルドしていないものだけをビルドします。)" #: src/cargo/deps.md:92 msgid "Voila! That's all there is to it!" @@ -7146,9 +7421,8 @@ msgid "" "as we saw before, but you can add additional binaries by placing them in a " "`bin/` directory:" msgstr "" -"`cargo`はこれもサポートしています。" -"以前見た通りデフォルトのバイナリ名は`main`ですが、" -"`bin/`ディレクトリに置くことで他のバイナリを追加できます。" +"`cargo`はこれもサポートしています。以前見た通りデフォルトのバイナリ名は`main`" +"ですが、`bin/`ディレクトリに置くことで他のバイナリを追加できます。" #: src/cargo/conventions.md:28 msgid "" @@ -7156,9 +7430,9 @@ msgid "" "`--bin my_other_bin` flag, where `my_other_bin` is the name of the binary we " "want to work with." msgstr "" -"このバイナリだけをコンパイルや実行するように`cargo`に伝えるには、" -"`cargo`に`--bin my_other_bin`フラグを渡します。" -"ここでは`my_other_bin`が対象のバイナリの名前です。" +"このバイナリだけをコンパイルや実行するように`cargo`に伝えるには、`cargo`に`--" +"bin my_other_bin`フラグを渡します。ここでは`my_other_bin`が対象のバイナリの名" +"前です。" #: src/cargo/conventions.md:32 msgid "" @@ -7166,8 +7440,9 @@ msgid "" "rust-lang.org/cargo/guide/project-layout.html) such as benchmarks, tests, " "and examples." msgstr "" -"バイナリの追加に加えて、`cargo`はベンチマークやテスト、サンプルなどの" -"[その他の機能](https://doc.rust-lang.org/cargo/guide/project-layout.html)もサポートしています。" +"バイナリの追加に加えて、`cargo`はベンチマークやテスト、サンプルなどの[その他" +"の機能](https://doc.rust-lang.org/cargo/guide/project-layout.html)もサポート" +"しています。" #: src/cargo/conventions.md:35 msgid "In the next chapter, we will look more closely at tests." @@ -7179,9 +7454,9 @@ msgid "" "class support for unit and integration testing ([see this chapter](https://" "doc.rust-lang.org/book/ch11-00-testing.html) in TRPL)." msgstr "" -"知っての通り、テストはどんなソフトウェアにも不可欠です!" -"Rustはユニットテストと統合テストを第一級にサポートしています" -"(TRPLの[この章を参照してください](https://doc.rust-lang.org/book/ch11-00-testing.html))。" +"知っての通り、テストはどんなソフトウェアにも不可欠です!Rustはユニットテスト" +"と統合テストを第一級にサポートしています(TRPLの[この章を参照してください]" +"(https://doc.rust-lang.org/book/ch11-00-testing.html))。" #: src/cargo/test.md:8 msgid "" @@ -7189,8 +7464,9 @@ msgid "" "integration tests. Organizationally, we can place unit tests in the modules " "they test and integration tests in their own `tests/` directory:" msgstr "" -"上のリンク先のテストの章では、ユニットテストと統合テストの書き方を紹介しています。" -"ユニットテストはテスト対象のモジュール内に、統合テストは`tests/`ディレクトリ内に置きます。" +"上のリンク先のテストの章では、ユニットテストと統合テストの書き方を紹介してい" +"ます。ユニットテストはテスト対象のモジュール内に、統合テストは`tests/`ディレ" +"クトリ内に置きます。" #: src/cargo/test.md:23 msgid "" @@ -7199,8 +7475,9 @@ msgid "" "is meant to test your library as if it were being called from a dependent " "crate." msgstr "" -"`tests`内の各ファイルは個別の[統合テスト](https://doc.rust-lang.org/book/ch11-03-test-organization.html#integration-tests)です。" -"これはライブラリを依存クレートから呼ばれたかのようにテストできます。" +"`tests`内の各ファイルは個別の[統合テスト](https://doc.rust-lang.org/book/" +"ch11-03-test-organization.html#integration-tests)です。これはライブラリを依存" +"クレートから呼ばれたかのようにテストできます。" #: src/cargo/test.md:28 msgid "" @@ -7208,9 +7485,10 @@ msgid "" "testing styles: [Unit](../testing/unit_testing.md), [Doc](../testing/" "doc_testing.md), and [Integration](../testing/integration_testing.md). " msgstr "" -"[テスト](../testing.md)の章は3つの異なるテストスタイルについて解説しています。" -"[単体テスト](../testing/unit_testing.md)、[ドキュメンテーションテスト](../testing/doc_testing.md)、" -"そして[結合テスト](../testing/integration_testing.md)です。" +"[テスト](../testing.md)の章は3つの異なるテストスタイルについて解説していま" +"す。[単体テスト](../testing/unit_testing.md)、[ドキュメンテーションテスト]" +"(../testing/doc_testing.md)、そして[結合テスト](../testing/" +"integration_testing.md)です。" #: src/cargo/test.md:31 msgid "`cargo` naturally provides an easy way to run all of your tests!" @@ -7220,10 +7498,6 @@ msgstr "`cargo`は、全てのテストを簡単に実行する方法を提供 msgid "You should see output like this:" msgstr "出力はこのようになります。" -#: src/cargo/test.md:54 -msgid "You can also run tests whose name matches a pattern:" -msgstr "パターンにマッチする名前のテストを実行することもできます。" - #: src/cargo/test.md:39 msgid "" "```shell\n" @@ -7256,6 +7530,10 @@ msgstr "" "test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out\n" "```" +#: src/cargo/test.md:54 +msgid "You can also run tests whose name matches a pattern:" +msgstr "パターンにマッチする名前のテストを実行することもできます。" + #: src/cargo/test.md:60 msgid "" "```shell\n" @@ -7289,16 +7567,16 @@ msgid "" "One word of caution: Cargo may run multiple tests concurrently, so make sure " "that they don't race with each other. " msgstr "" -"注意:Cargoは複数のテストを並列で実行することがありますので、" -"それらが互いに競合しないようにしてください。" +"注意:Cargoは複数のテストを並列で実行することがありますので、それらが互いに競" +"合しないようにしてください。" #: src/cargo/test.md:76 msgid "" "One example of this concurrency causing issues is if two tests output to a " "file, such as below:" msgstr "" -"並行性が問題を引き起こす一例として、以下のように、" -"2つのテストが1つのファイルに出力するケースがあります。" +"並行性が問題を引き起こす一例として、以下のように、2つのテストが1つのファイル" +"に出力するケースがあります。" #: src/cargo/test.md:82 msgid "// Import the necessary modules\n" @@ -7359,16 +7637,18 @@ msgid "" "like code generation, or some native code that needs to be compiled. To " "solve this problem we have build scripts that Cargo can run." msgstr "" -"`cargo`による通常のビルドでは十分でないことが時々あります。" -"コード生成や、コンパイルが必要なネイティブコードなど、" -"`cargo`がクレートをうまくコンパイルするにはなんらかの前提条件が必要かもしれません。" -"この問題を解決するため、Cargoが実行できるビルドスクリプトがあります。" +"`cargo`による通常のビルドでは十分でないことが時々あります。コード生成や、コン" +"パイルが必要なネイティブコードなど、`cargo`がクレートをうまくコンパイルするに" +"はなんらかの前提条件が必要かもしれません。この問題を解決するため、Cargoが実行" +"できるビルドスクリプトがあります。" #: src/cargo/build_scripts.md:8 msgid "" "To add a build script to your package it can either be specified in the " "`Cargo.toml` as follows:" -msgstr "ビルドスクリプトをパッケージに追加するには、以下のように`Cargo.toml`の中で指定できます。" +msgstr "" +"ビルドスクリプトをパッケージに追加するには、以下のように`Cargo.toml`の中で指" +"定できます。" #: src/cargo/build_scripts.md:11 msgid "" @@ -7388,7 +7668,9 @@ msgstr "" msgid "" "Otherwise Cargo will look for a `build.rs` file in the project directory by " "default." -msgstr "それ以外の場合、Cargoはデフォルトでプロジェクトディレクトリから`build.rs`を探します。" +msgstr "" +"それ以外の場合、Cargoはデフォルトでプロジェクトディレクトリから`build.rs`を探" +"します。" #: src/cargo/build_scripts.md:20 msgid "How to use a build script" @@ -7400,9 +7682,9 @@ msgid "" "invoked prior to compiling anything else in the package. Hence it can be " "used to fulfill pre-requisites of your crate." msgstr "" -"ビルドスクリプトは単にRustのファイルの1つで、" -"パッケージ内の他のファイルをコンパイルする前にコンパイルされて起動されます。" -"そのため、クレートの前提条件を満たすために使用できます。" +"ビルドスクリプトは単にRustのファイルの1つで、パッケージ内の他のファイルをコン" +"パイルする前にコンパイルされて起動されます。そのため、クレートの前提条件を満" +"たすために使用できます。" #: src/cargo/build_scripts.md:26 msgid "" @@ -7410,8 +7692,9 @@ msgid "" "here](https://doc.rust-lang.org/cargo/reference/environment-variables." "html#environment-variables-cargo-sets-for-build-scripts) that can be used." msgstr "" -"Cargoは、[ここで指定された](https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-build-scripts)" -"環境変数を介してスクリプトに入力を与えます。" +"Cargoは、[ここで指定された](https://doc.rust-lang.org/cargo/reference/" +"environment-variables.html#environment-variables-cargo-sets-for-build-" +"scripts)環境変数を介してスクリプトに入力を与えます。" #: src/cargo/build_scripts.md:29 msgid "" @@ -7420,24 +7703,26 @@ msgid "" "will be interpreted by Cargo directly and hence can be used to define " "parameters for the package's compilation." msgstr "" -"スクリプトは標準出力に出力します。" -"出力される行は全て、`target/debug/build//output`に書き込まれます。" -"さらに、行頭に`cargo:`がついた行はCargoに直接解釈されるため、" -"パッケージのコンパイル時のパラメーターを定義するのに使用できます。" +"スクリプトは標準出力に出力します。出力される行は全て、`target/debug/build/" +"/output`に書き込まれます。さらに、行頭に`cargo:`がついた行はCargoに直接" +"解釈されるため、パッケージのコンパイル時のパラメーターを定義するのに使用でき" +"ます。" #: src/cargo/build_scripts.md:34 msgid "" "For further specification and examples have a read of the [Cargo " "specification](https://doc.rust-lang.org/cargo/reference/build-scripts.html)." msgstr "" -"より詳細な仕様や例については、" -"[Cargo specification](https://doc.rust-lang.org/cargo/reference/build-scripts.html)を参照してください。" +"より詳細な仕様や例については、[Cargo specification](https://doc.rust-lang." +"org/cargo/reference/build-scripts.html)を参照してください。" #: src/attribute.md:3 msgid "" "An attribute is metadata applied to some module, crate or item. This " "metadata can be used to/for:" -msgstr "アトリビュートはモジュール、クレート、要素に対するメタデータです。以下がその使用目的です。" +msgstr "" +"アトリビュートはモジュール、クレート、要素に対するメタデータです。以下がその" +"使用目的です。" #: src/attribute.md:8 msgid "[conditional compilation of code](attribute/cfg.md)" @@ -7447,7 +7732,8 @@ msgstr "[コンパイル時の条件分岐](attribute/cfg.md)" msgid "" "[set crate name, version and type (binary or library)](attribute/crate.md)" msgstr "" -"[クレート名、バージョン、種類(バイナリか、ライブラリか)の設定](attribute/crate.md)" +"[クレート名、バージョン、種類(バイナリか、ライブラリか)の設定](attribute/" +"crate.md)" #: src/attribute.md:10 msgid "" @@ -7498,7 +7784,7 @@ msgid "" "`#![inner_attribute]` applies to the enclosing [item](https://doc.rust-lang." "org/stable/reference/items.html) (typically a module or a crate). In other " "words, this attribute is interpreted as applying to the entire scope in " -"which it's place. Here is an example where `#![allow(unusude_variables)]` " +"which it's placed. Here is an example where `#![allow(unused_variables)]` " "applies to the whole crate (if placed in `main.rs`):" msgstr "" @@ -7526,7 +7812,8 @@ msgstr "`#[attribute(value)]`" msgid "" "Attributes can have multiple values and can be separated over multiple " "lines, too:" -msgstr "アトリビュートは複数の値を取ることができ、複数の行に分割することもできます。" +msgstr "" +"アトリビュートは複数の値を取ることができ、複数の行に分割することもできます。" #: src/attribute/unused.md:3 msgid "" @@ -7534,14 +7821,15 @@ msgid "" "Lint_%28software%29) that will warn about unused functions. An _attribute_ " "can be used to disable the lint." msgstr "" -"コンパイラは`dead_code`と呼ばれる[リント](https://en.wikipedia.org/wiki/Lint_%28software%29)機能を持つため、" -"使用されていない関数が存在するときに警告を出します。" -"*アトリビュート* によってこの機能を無効化することができます。" +"コンパイラは`dead_code`と呼ばれる[リント](https://en.wikipedia.org/wiki/Lint_" +"%28software%29)機能を持つため、使用されていない関数が存在するときに警告を出し" +"ます。*アトリビュート* によってこの機能を無効化することができます。" #: src/attribute/unused.md:9 msgid "" "// `#[allow(dead_code)]` is an attribute that disables the `dead_code` lint\n" -msgstr "/ `#[allow(dead_code)]`は`dead_code`リントを抑制するアトリビュートです。\n" +msgstr "" +"/ `#[allow(dead_code)]`は`dead_code`リントを抑制するアトリビュートです。\n" #: src/attribute/unused.md:14 msgid "// FIXME ^ Add an attribute to suppress the warning\n" @@ -7553,9 +7841,9 @@ msgid "" "examples we'll allow dead code in some places because of the interactive " "nature of the examples." msgstr "" -"実際のコード中では、使用されていないコードが有る場合はそれを除外するべきです。" -"この文書中では随所でアトリビュートによって警告を抑制していますが、" -"それはあくまでインタラクティブな例を皆さんに提供するためです。" +"実際のコード中では、使用されていないコードが有る場合はそれを除外するべきで" +"す。この文書中では随所でアトリビュートによって警告を抑制していますが、それは" +"あくまでインタラクティブな例を皆さんに提供するためです。" #: src/attribute/crate.md:3 msgid "" @@ -7563,10 +7851,10 @@ msgid "" "is a binary or a library (and even which type of library), and the " "`crate_name` attribute can be used to set the name of the crate." msgstr "" -"`crate_type`アトリビュートは、そのクレートがライブラリ、バイナリのいずれに" -"コンパイルされるべきかをコンパイラに伝えるために使用します。" -"ライブラリの場合は、どのタイプのライブラリであるかも伝えることができます。" -"`crate_name`はクレートの名前を決定するのに使用します。" +"`crate_type`アトリビュートは、そのクレートがライブラリ、バイナリのいずれにコ" +"ンパイルされるべきかをコンパイラに伝えるために使用します。ライブラリの場合" +"は、どのタイプのライブラリであるかも伝えることができます。`crate_name`はク" +"レートの名前を決定するのに使用します。" #: src/attribute/crate.md:7 msgid "" @@ -7575,9 +7863,10 @@ msgid "" "manager. Since Cargo is used for the majority of Rust projects, this means " "real-world uses of `crate_type` and `crate_name` are relatively limited." msgstr "" -"しかし、`crate_type`アトリビュートも`crate_name`アトリビュートも、" -"RustのパッケージマネージャCargoを利用している場合は**何の**影響もないと知っておくことは重要です。" -"Cargoは大半のRustプロジェクトで利用されており、実世界での`crate_type`と`crate_name`の利用は比較的限られています。" +"しかし、`crate_type`アトリビュートも`crate_name`アトリビュートも、Rustのパッ" +"ケージマネージャCargoを利用している場合は**何の**影響もないと知っておくことは" +"重要です。Cargoは大半のRustプロジェクトで利用されており、実世界での" +"`crate_type`と`crate_name`の利用は比較的限られています。" #: src/attribute/crate.md:13 msgid "// This crate is a library\n" @@ -7600,8 +7889,8 @@ msgid "" "When the `crate_type` attribute is used, we no longer need to pass the `--" "crate-type` flag to `rustc`." msgstr "" -"`crate_type`アトリビュートが使用されているときは、" -"`rustc`に`--crate-type`フラグを伝える必要はありません。" +"`crate_type`アトリビュートが使用されているときは、`rustc`に`--crate-type`フラ" +"グを伝える必要はありません。" #: src/attribute/cfg.md:3 msgid "" @@ -7623,8 +7912,9 @@ msgid "" "evaluates to `true` or `false` literals allowing for checks at run-time. " "Both utilize identical argument syntax." msgstr "" -"前者は条件付きコンパイルを行いますが、後者は`true`または`false`リテラルに評価され実行時にチェックすることが可能です。" -"いずれの場合も適切なシンタックスで記述する必要があります。" +"前者は条件付きコンパイルを行いますが、後者は`true`または`false`リテラルに評価" +"され実行時にチェックすることが可能です。いずれの場合も適切なシンタックスで記" +"述する必要があります。" #: src/attribute/cfg.md:12 msgid "" @@ -7633,9 +7923,9 @@ msgid "" "when `cfg!` is used for the condition, regardless of what `cfg!` is " "evaluating." msgstr "" -"`#[cfg]`と異なり、`cfg!`はコードを削除せず、trueまたはfalseに評価されるだけです。" -"例えば、`cfg!`が何を評価しているかに関係なく、`cfg!`が条件に利用されるとき、" -"if/else式の中のすべてのブロックが有効でなくてはなりません。" +"`#[cfg]`と異なり、`cfg!`はコードを削除せず、trueまたはfalseに評価されるだけで" +"す。例えば、`cfg!`が何を評価しているかに関係なく、`cfg!`が条件に利用されると" +"き、if/else式の中のすべてのブロックが有効でなくてはなりません。" #: src/attribute/cfg.md:15 msgid "// This function only gets compiled if the target OS is linux\n" @@ -7652,7 +7942,9 @@ msgstr "\"You are running linux!\"" #: src/attribute/cfg.md:20 msgid "" "// And this function only gets compiled if the target OS is *not* linux\n" -msgstr "// そしてこの関数はターゲットOSがLinux *ではない* ときのみコンパイルされます。\n" +msgstr "" +"// そしてこの関数はターゲットOSがLinux *ではない* ときのみコンパイルされま" +"す。\n" #: src/attribute/cfg.md:24 msgid "\"You are *not* running linux!\"" @@ -7685,8 +7977,9 @@ msgid "" "Some conditionals like `target_os` are implicitly provided by `rustc`, but " "custom conditionals must be passed to `rustc` using the `--cfg` flag." msgstr "" -"`target_os`のように、いくつかの条件分岐は`rustc`が暗黙のうちに提供しています。" -"条件を独自に追加する場合には`--cfg`フラグを用いて`rustc`に伝える必要があります。" +"`target_os`のように、いくつかの条件分岐は`rustc`が暗黙のうちに提供していま" +"す。条件を独自に追加する場合には`--cfg`フラグを用いて`rustc`に伝える必要があ" +"ります。" #: src/attribute/cfg/custom.md:9 msgid "\"condition met!\"" @@ -7709,10 +8002,11 @@ msgid "" "considered valid. The simplest and most common use of generics is for type " "parameters." msgstr "" -"ジェネリクスとは、型と関数の機能をより汎用的に使えるようにするための機能です。" -"これはあらゆる局面でコードの重複を避けるために非常に役立ちますが、多少構文が複雑になります。" -"すなわち、ジェネリック型を使いこなすには、どのようなジェネリック型がきちんと機能するかに細心の注意を払う必要があります。" -"最もシンプルで一般的なジェネリクスの利用法は型パラメータです。" +"ジェネリクスとは、型と関数の機能をより汎用的に使えるようにするための機能で" +"す。これはあらゆる局面でコードの重複を避けるために非常に役立ちますが、多少構" +"文が複雑になります。すなわち、ジェネリック型を使いこなすには、どのようなジェ" +"ネリック型がきちんと機能するかに細心の注意を払う必要があります。最もシンプル" +"で一般的なジェネリクスの利用法は型パラメータです。" #: src/generics.md:10 msgid "" @@ -7723,18 +8017,20 @@ msgid "" "parameters ``. Any type specified as a generic type parameter is " "generic, and everything else is concrete (non-generic)." msgstr "" -"ジェネリック型の型パラメータにはかぎ括弧と" -"アッパー[キャメルケース](https://en.wikipedia.org/wiki/CamelCase)(``)が使われます。" -"ジェネリックな型パラメータはたいていの場合``で示されます。" -"Rustの場合、「ジェネリクス」には「1つ以上のジェネリックな型パラメータ``を受け付けるもの」という意味もあります。" -"ジェネリックな型パラメータを指定された場合、それは必ずジェネリック型になり、" -"そうでなければ必ず非ジェネリック型、すなわち具象型になります。" +"ジェネリック型の型パラメータにはかぎ括弧とアッパー[キャメルケース](https://" +"en.wikipedia.org/wiki/CamelCase)(``)が使われます。ジェネリッ" +"クな型パラメータはたいていの場合``で示されます。Rustの場合、「ジェネリク" +"ス」には「1つ以上のジェネリックな型パラメータ``を受け付けるもの」という意" +"味もあります。ジェネリックな型パラメータを指定された場合、それは必ずジェネ" +"リック型になり、そうでなければ必ず非ジェネリック型、すなわち具象型になりま" +"す。" #: src/generics.md:16 msgid "" "For example, defining a _generic function_ named `foo` that takes an " "argument `T` of any type:" -msgstr "例として、あらゆる型の引数`T`をとる *ジェネリック関数* `foo`を定義すると" +msgstr "" +"例として、あらゆる型の引数`T`をとる *ジェネリック関数* `foo`を定義すると" #: src/generics.md:23 msgid "" @@ -7742,9 +8038,9 @@ msgid "" "is considered generic when used here as `(arg: T)`. This is the case even if " "`T` has previously been defined as a `struct`." msgstr "" -"となります。`T`はジェネリックな型パラメータに指定されているので、" -"この場所で`(arg: T)`のように使用するとジェネリック型として扱われます。" -"これは`T`という構造体がそれ以前に定義されていても同様です。" +"となります。`T`はジェネリックな型パラメータに指定されているので、この場所で" +"`(arg: T)`のように使用するとジェネリック型として扱われます。これは`T`という構" +"造体がそれ以前に定義されていても同様です。" #: src/generics.md:27 msgid "This example shows some of the syntax in action:" @@ -7760,8 +8056,10 @@ msgid "" "``.\n" "// Therefore, `Single` is a concrete type, and `A` is defined as above.\n" msgstr "" -"// `Single`という型を定義する際に`A`を使用していますが、その最初の使用よりも先に\n" -"// ``がないため、また、`A`自身も具象型であるため、`Single`は具象型となります。\n" +"// `Single`という型を定義する際に`A`を使用していますが、その最初の使用よりも" +"先に\n" +"// ``がないため、また、`A`自身も具象型であるため、`Single`は具象型となりま" +"す。\n" #: src/generics.md:35 msgid "// ^ Here is `Single`s first use of the type `A`.\n" @@ -7796,7 +8094,8 @@ msgstr "" #: src/generics.md:52 msgid "// `SingleGen` can also have a type parameter implicitly specified:\n" -msgstr "// `SingleGen`型の変数には明示的に型パラメータを与えなくても構いません。\n" +msgstr "" +"// `SingleGen`型の変数には明示的に型パラメータを与えなくても構いません。\n" #: src/generics.md:53 msgid "// Uses `A` defined at the top.\n" @@ -7818,7 +8117,9 @@ msgstr "[構造体](custom_types/structs.md)" msgid "" "The same set of rules can be applied to functions: a type `T` becomes " "generic when preceded by ``." -msgstr "「型`T`はその前に``があるとジェネリック型になる」というルールは関数に対しても当てはまります。" +msgstr "" +"「型`T`はその前に``があるとジェネリック型になる」というルールは関数に対し" +"ても当てはまります。" #: src/generics/gen_fn.md:6 msgid "" @@ -7827,14 +8128,17 @@ msgid "" "type is generic, or if the compiler doesn't have enough information to " "infer the necessary type parameters." msgstr "" -"ジェネリック関数を使用する際、型パラメータを明示する必要がある場合があります。" -"返り値がジェネリック型である場合や、コンパイラが型パラメータを推論するのに十分な情報がない場合です。" +"ジェネリック関数を使用する際、型パラメータを明示する必要がある場合がありま" +"す。返り値がジェネリック型である場合や、コンパイラが型パラメータを推論するの" +"に十分な情報がない場合です。" #: src/generics/gen_fn.md:11 msgid "" "A function call with explicitly specified type parameters looks like: `fun::" "()`." -msgstr "型パラメータを明示したうえでの関数呼び出しの構文は`fun::()`のようになります。" +msgstr "" +"型パラメータを明示したうえでの関数呼び出しの構文は`fun::()`のよう" +"になります。" #: src/generics/gen_fn.md:15 msgid "// Concrete type `A`.\n" @@ -7899,7 +8203,8 @@ msgid "" "`T`.\n" msgstr "" "// `generic`という関数を定義。`SGen`という型の引数`_s`を取ります。\n" -"// ``が`SGen`に先行しているため、これはTに対してジェネリックな関数です。\n" +"// ``が`SGen`に先行しているため、これはTに対してジェネリックな関数で" +"す。\n" #: src/generics/gen_fn.md:41 msgid "// Using the non-generic functions\n" @@ -7935,7 +8240,9 @@ msgstr "[関数](../fn.md), [構造体](../custom_types/structs.md)" #: src/generics/impl.md:3 msgid "Similar to functions, implementations require care to remain generic." -msgstr "関数と同様、`impl`でメソッドを実装する際にもジェネリック型特有の記法が必要です。" +msgstr "" +"関数と同様、`impl`でメソッドを実装する際にもジェネリック型特有の記法が必要で" +"す。" #: src/generics/impl.md:6 msgid "// Concrete type `S`\n" @@ -7974,8 +8281,8 @@ msgid "" "[functions returning references](../scope/lifetime/fn.md), [`impl`](../fn/" "methods.md), and [`struct`](../custom_types/structs.md)" msgstr "" -"[参照を返す関数](../scope/lifetime/fn.md), [`impl`](../fn/" -"methods.md), [構造体](../custom_types/structs.md)" +"[参照を返す関数](../scope/lifetime/fn.md), [`impl`](../fn/methods.md), [構造" +"体](../custom_types/structs.md)" #: src/generics/gen_trait.md:3 msgid "" @@ -7983,15 +8290,16 @@ msgid "" "reimplements the `Drop` `trait` as a generic method to `drop` itself and an " "input." msgstr "" -"もちろんトレイトもジェネリクスを活用することができます。" -"ここでは`Drop`トレイトをジェネリックメソッドとして再実装し、" -"自身と引数として受け取った値の両方を`drop`するようなメソッドにします。" +"もちろんトレイトもジェネリクスを活用することができます。ここでは`Drop`トレイ" +"トをジェネリックメソッドとして再実装し、自身と引数として受け取った値の両方を" +"`drop`するようなメソッドにします。" #: src/generics/gen_trait.md:7 msgid "// Non-copyable types.\n" msgstr "" "// コピー不可な型\n" -"// 訳注: `clone()`メソッドを用いないかぎり、値のコピーではなくムーブが起きる型\n" +"// 訳注: `clone()`メソッドを用いないかぎり、値のコピーではなくムーブが起きる" +"型\n" #: src/generics/gen_trait.md:10 msgid "// A trait generic over `T`.\n" @@ -8048,11 +8356,11 @@ msgid "" "following example uses the trait `Display` to print and so it requires `T` " "to be bound by `Display`; that is, `T` _must_ implement `Display`." msgstr "" -"ジェネリックプログラミングをしていると、型パラメータが特定の機能を持っていることを規定するため、" -"トレイトに境界を設ける必要があることがよくあります。" -"例えば、以下の例では、引数の`Display`トレイトを用いて出力を行うため、" -"`T`が`Display`を持っていることを規定しています。" -"つまり、「`T`は`Display`を実装 *していなくてはならない* 」という意味です。" +"ジェネリックプログラミングをしていると、型パラメータが特定の機能を持っている" +"ことを規定するため、トレイトに境界を設ける必要があることがよくあります。例え" +"ば、以下の例では、引数の`Display`トレイトを用いて出力を行うため、`T`が" +"`Display`を持っていることを規定しています。つまり、「`T`は`Display`を実装 *し" +"ていなくてはならない* 」という意味です。" #: src/generics/bounds.md:9 msgid "" @@ -8065,7 +8373,9 @@ msgstr "" #: src/generics/bounds.md:16 msgid "" "Bounding restricts the generic to types that conform to the bounds. That is:" -msgstr "境界は、ジェネリクスを全ての型ではなく、一定条件を満たす型に対してのみ適用するためにあります。つまり" +msgstr "" +"境界は、ジェネリクスを全ての型ではなく、一定条件を満たす型に対してのみ適用す" +"るためにあります。つまり" #: src/generics/bounds.md:20 msgid "" @@ -8081,9 +8391,9 @@ msgid "" "the [methods](../fn/methods.md) of traits specified in the bounds. For " "example:" msgstr "" -"境界のもう一つの効果は、ジェネリック型のインスタンスが、" -"境界条件となるトレイトの[メソッド](../fn/methods.md)" -"にアクセスすることができるようになる点です。以下がその例です。" +"境界のもう一つの効果は、ジェネリック型のインスタンスが、境界条件となるトレイ" +"トの[メソッド](../fn/methods.md)にアクセスすることができるようになる点です。" +"以下がその例です。" #: src/generics/bounds.md:30 msgid "// A trait which implements the print marker: `{:?}`.\n" @@ -8095,7 +8405,8 @@ msgid "" "// of the type, this will work properly.\n" msgstr "" "// ジェネリック型`T`は`Debug`トレイトを実装していなくてはなりません。\n" -"// その限りにおいて、`T`がどのような具象型であろうとも次の関数は動作します。\n" +"// その限りにおいて、`T`がどのような具象型であろうとも次の関数は動作しま" +"す。\n" #: src/generics/bounds.md:51 msgid "" @@ -8126,16 +8437,17 @@ msgid "" "As an additional note, [`where`](../generics/where.md) clauses can also be " "used to apply bounds in some cases to be more expressive." msgstr "" -"付け加えておくと、[`where`](../generics/where.md)句を用いて境界を適用することもできます。" -"場合によってはこちらの記法を使用したほうが読みやすくなる場合もあります。" +"付け加えておくと、[`where`](../generics/where.md)句を用いて境界を適用すること" +"もできます。場合によってはこちらの記法を使用したほうが読みやすくなる場合もあ" +"ります。" #: src/generics/bounds.md:75 msgid "" "[`std::fmt`](../hello/print.md), [`struct`s](../custom_types/structs.md), " "and [`trait`s](../trait.md)" msgstr "" -"[`std::fmt`](../hello/print.md), [構造体](../custom_types/structs.md), " -"[トレイト](../trait.md)" +"[`std::fmt`](../hello/print.md), [構造体](../custom_types/structs.md), [トレ" +"イト](../trait.md)" #: src/generics/bounds/testcase_empty.md:3 msgid "" @@ -8143,8 +8455,9 @@ msgid "" "any functionality, you can still use it as a bound. `Eq` and `Copy` are " "examples of such `trait`s from the `std` library." msgstr "" -"トレイト境界の仕組みから、「トレイトがなにも機能を持っていなくとも境界条件として使用できることには変わりはない」" -"という帰結がもたらされます。`Eq`と`Copy`は`std`ライブラリにおけるそのような例です。" +"トレイト境界の仕組みから、「トレイトがなにも機能を持っていなくとも境界条件と" +"して使用できることには変わりはない」という帰結がもたらされます。`Eq`と`Copy`" +"は`std`ライブラリにおけるそのような例です。" #: src/generics/bounds/testcase_empty.md:17 msgid "" @@ -8193,14 +8506,16 @@ msgid "" "[`trait`s](../../trait.md)" msgstr "" "[`std::cmp::Eq`](https://doc.rust-lang.org/std/cmp/trait.Eq.html), [`std::" -"marker::Copy`](https://doc.rust-lang.org/std/marker/trait.Copy.html), " -"[トレイト](../../trait.md)" +"marker::Copy`](https://doc.rust-lang.org/std/marker/trait.Copy.html), [トレイ" +"ト](../../trait.md)" #: src/generics/multi_bounds.md:3 msgid "" "Multiple bounds for a single type can be applied with a `+`. Like normal, " "different types are separated with `,`." -msgstr "`+`を用いて1つの型に複数のトレイト境界を設けることができます。複数の引数を受け取るときは、通常時と同様、`,`で区切ります。" +msgstr "" +"`+`を用いて1つの型に複数のトレイト境界を設けることができます。複数の引数を受" +"け取るときは、通常時と同様、`,`で区切ります。" #: src/generics/multi_bounds.md:10 msgid "\"Debug: `{:?}`\"" @@ -8250,7 +8565,8 @@ msgstr "`where`句のほうが有効なケースには例えば以下のよう #: src/generics/where.md:10 msgid "When specifying generic types and bounds separately is clearer:" -msgstr "ジェネリック型とジェネリック境界に別々に制限を加えたほうが明瞭になる場合" +msgstr "" +"ジェネリック型とジェネリック境界に別々に制限を加えたほうが明瞭になる場合" #: src/generics/where.md:14 msgid "// Expressing bounds with a `where` clause\n" @@ -8261,7 +8577,9 @@ msgid "" "When using a `where` clause is more expressive than using normal syntax. " "The `impl` in this example cannot be directly expressed without a `where` " "clause:" -msgstr "`where`句の方が通常の構文より表現力が高い場合。この例では`where`句を使わずに書くことはできません。" +msgstr "" +"`where`句の方が通常の構文より表現力が高い場合。この例では`where`句を使わずに" +"書くことはできません。" #: src/generics/where.md:30 msgid "" @@ -8285,45 +8603,52 @@ msgid "" "[RFC](https://github.com/rust-lang/rfcs/blob/master/text/0135-where.md), " "[`struct`](../custom_types/structs.md), and [`trait`](../trait.md)" msgstr "" -"[RFC](https://github.com/rust-lang/rfcs/blob/master/text/0135-where.md), " -"[構造体](../custom_types/structs.md), [トレイト](../trait.md)" +"[RFC](https://github.com/rust-lang/rfcs/blob/master/text/0135-where.md), [構" +"造体](../custom_types/structs.md), [トレイト](../trait.md)" #: src/generics/new_types.md:3 msgid "" "The `newtype` idiom gives compile time guarantees that the right type of " "value is supplied to a program." msgstr "" -"ニュータイプイディオムは正しい型の値が与えられていることをコンパイル時に保証することができます。" +"ニュータイプイディオムは正しい型の値が与えられていることをコンパイル時に保証" +"することができます。" #: src/generics/new_types.md:6 msgid "" "For example, an age verification function that checks age in years, _must_ " "be given a value of type `Years`." -msgstr "例えば、年齢を年単位で確認する`old_enough`には「Years」という型の値を *与えなければならない* ようにすることが可能です。" +msgstr "" +"例えば、年齢を年単位で確認する`old_enough`には「Years」という型の値を *与えな" +"ければならない* ようにすることが可能です。" #: src/generics/new_types.md:22 msgid "/// truncates partial years\n" msgstr "/// 1年に満たない日付は切り捨て。\n" #: src/generics/new_types.md:35 src/generics/new_types.md:36 -msgid "\"Old enough {}\"" -msgstr "\"Old enough {}\"" +msgid "\"Is an adult? {}\"" +msgstr "" #: src/generics/new_types.md:37 -msgid "// println!(\"Old enough {}\", old_enough(&age_days));\n" -msgstr "// println!(\"Old enough {}\", old_enough(&age_days));\n" +msgid "// println!(\"Is an adult? {}\", is_adult(&age_days));\n" +msgstr "// println!(\"Is an adult? {}\", is_adult(&age_days));\n" #: src/generics/new_types.md:41 msgid "" "Uncomment the last print statement to observe that the type supplied must be " "`Years`." -msgstr "最後の print文 のコメントを外して、与えられた型が `Years` でなければならないことを確認してください。" +msgstr "" +"最後の print文 のコメントを外して、与えられた型が `Years` でなければならない" +"ことを確認してください。" #: src/generics/new_types.md:43 msgid "" "To obtain the `newtype`'s value as the base type, you may use the tuple or " "destructuring syntax like so:" -msgstr "`newtype`の元に使われている型のデータを取得するには、以下のようにタプルやデストラクト構文を用いることで取得できます。" +msgstr "" +"`newtype`の元に使われている型のデータを取得するには、以下のようにタプルやデス" +"トラクト構文を用いることで取得できます。" #: src/generics/new_types.md:49 msgid "// Tuple\n" @@ -8344,16 +8669,18 @@ msgid "" "extension to `trait` generics, and allows `trait`s to internally define new " "items." msgstr "" -"関連要素とは複数の型の[要素](https://doc.rust-lang.org/reference/items.html)に関係のある規則の総称です。" -"トレイトの拡張機能であり、トレイトの中で新しい要素を定義することを可能にします。" +"関連要素とは複数の型の[要素](https://doc.rust-lang.org/reference/items.html)" +"に関係のある規則の総称です。トレイトの拡張機能であり、トレイトの中で新しい要" +"素を定義することを可能にします。" #: src/generics/assoc_items.md:7 msgid "" "One such item is called an _associated type_, providing simpler usage " "patterns when the `trait` is generic over its container type." msgstr "" -"そのように定義する要素の一つに **関連型** があります。" -"これにより、ジェネリックなコンテナ型に対するトレイトを使用する際に、よりシンプルな書き方ができるようになります。" +"そのように定義する要素の一つに **関連型** があります。これにより、ジェネリッ" +"クなコンテナ型に対するトレイトを使用する際に、よりシンプルな書き方ができるよ" +"うになります。" #: src/generics/assoc_items.md:12 msgid "" @@ -8368,8 +8695,8 @@ msgid "" "A `trait` that is generic over its container type has type specification " "requirements - users of the `trait` _must_ specify all of its generic types." msgstr "" -"コンテナ型に、その要素に対してジェネリックなトレイトを実装した場合、" -"そのトレイトを使用する者は全てのジェネリック型を明記 *しなくてはなりません* 。" +"コンテナ型に、その要素に対してジェネリックなトレイトを実装した場合、そのトレ" +"イトを使用する者は全てのジェネリック型を明記 *しなくてはなりません* 。" #: src/generics/assoc_items/the_problem.md:6 msgid "" @@ -8379,8 +8706,8 @@ msgid "" "difference()`." msgstr "" "以下の例では`Contains`トレイトはジェネリック型`A`と`B`の使用を許しています。" -"その後、`Container`型に対して`Contains`を実装していますが、" -"その際後に`fn difference()`が使用できるように、`A`、`B`はそれぞれ`i32`と明記されています。" +"その後、`Container`型に対して`Contains`を実装していますが、その際後に`fn " +"difference()`が使用できるように、`A`、`B`はそれぞれ`i32`と明記されています。" #: src/generics/assoc_items/the_problem.md:10 msgid "" @@ -8389,9 +8716,10 @@ msgid "" "express that `A` and `B` are determined by the _input_ `C`. As you will see " "in the next section, associated types provide exactly that capability." msgstr "" -"`Contains`はジェネリックトレイトなので、`fn difference()`では **全ての** ジェネリック型を宣言しなくてはなりません。" -"実際のところ、`A`と`B`は **引数** である`C`によって決定されていて欲しいにも関わらず、です。" -"これは次のページで紹介する関連型と呼ばれる機能によって可能です。" +"`Contains`はジェネリックトレイトなので、`fn difference()`では **全ての** ジェ" +"ネリック型を宣言しなくてはなりません。実際のところ、`A`と`B`は **引数** であ" +"る`C`によって決定されていて欲しいにも関わらず、です。これは次のページで紹介す" +"る関連型と呼ばれる機能によって可能です。" #: src/generics/assoc_items/the_problem.md:17 #: src/generics/assoc_items/types.md:36 @@ -8456,8 +8784,7 @@ msgstr "\"The difference is: {}\"" #: src/generics/assoc_items/the_problem.md:64 msgid "" "[`struct`s](../../custom_types/structs.md), and [`trait`s](../../trait.md)" -msgstr "" -"[構造体](../../custom_types/structs.md), [トレイト](../../trait.md)" +msgstr "[構造体](../../custom_types/structs.md), [トレイト](../../trait.md)" #: src/generics/assoc_items/types.md:3 msgid "" @@ -8465,8 +8792,9 @@ msgid "" "moving inner types locally into a trait as _output_ types. Syntax for the " "`trait` definition is as follows:" msgstr "" -"関連型を使用すると、コンテナ型の中の要素をトレイトの中に *出力型* として書くことで、" -"全体の可読性を上げることができます。トレイトを定義する際の構文は以下のようになります。" +"関連型を使用すると、コンテナ型の中の要素をトレイトの中に *出力型* として書く" +"ことで、全体の可読性を上げることができます。トレイトを定義する際の構文は以下" +"のようになります。" #: src/generics/assoc_items/types.md:8 msgid "" @@ -8488,7 +8816,9 @@ msgstr "" msgid "" "Note that functions that use the `trait` `Contains` are no longer required " "to express `A` or `B` at all:" -msgstr "`Contains`トレイトを使用する関数において、`A`と`B`を明示する必要がなくなっていることに注目しましょう。" +msgstr "" +"`Contains`トレイトを使用する関数において、`A`と`B`を明示する必要がなくなって" +"いることに注目しましょう。" #: src/generics/assoc_items/types.md:24 msgid "// Without using associated types\n" @@ -8525,8 +8855,8 @@ msgid "" "A phantom type parameter is one that doesn't show up at runtime, but is " "checked statically (and only) at compile time." msgstr "" -"幽霊型とは実行時には存在しないけれども、" -"コンパイル時に静的に型チェックされるような型のことです。" +"幽霊型とは実行時には存在しないけれども、コンパイル時に静的に型チェックされる" +"ような型のことです。" #: src/generics/phantom.md:6 msgid "" @@ -8534,9 +8864,10 @@ msgid "" "perform type checking at compile time. These extra parameters hold no " "storage values, and have no runtime behavior." msgstr "" -"構造体などのデータ型は、ジェネリック型パラメータを一つ余分に持ち、" -"それをマーカーとして使ったりコンパイル時の型検査に使ったりすることができます。" -"このマーカーは実際の値を何も持たず、したがって実行時の挙動そのものにはいかなる影響ももたらしません。" +"構造体などのデータ型は、ジェネリック型パラメータを一つ余分に持ち、それをマー" +"カーとして使ったりコンパイル時の型検査に使ったりすることができます。このマー" +"カーは実際の値を何も持たず、したがって実行時の挙動そのものにはいかなる影響も" +"もたらしません。" #: src/generics/phantom.md:10 msgid "" @@ -8544,8 +8875,9 @@ msgid "" "rust-lang.org/std/marker/struct.PhantomData.html) with the phantom type " "parameter concept to create tuples containing different data types." msgstr "" -"以下の例では、そのようなマーカーとして幽霊型([std::marker::PhantomData](https://doc.rust-lang.org/std/marker/struct.PhantomData.html))" -"を用い、それぞれ異なった型の値を持つタプルを作成します。" +"以下の例では、そのようなマーカーとして幽霊型([std::marker::PhantomData]" +"(https://doc.rust-lang.org/std/marker/struct.PhantomData.html))を用い、それ" +"ぞれ異なった型の値を持つタプルを作成します。" #: src/generics/phantom.md:16 msgid "" @@ -8622,16 +8954,16 @@ msgid "" "[Derive](../trait/derive.md), [struct](../custom_types/structs.md), and " "[TupleStructs](../custom_types/structs.md)" msgstr "" -"[導出](../trait/derive.md), [構造体](../custom_types/structs.md), " -"[タプル構造体](../custom_types/structs.md)" +"[導出](../trait/derive.md), [構造体](../custom_types/structs.md), [タプル構造" +"体](../custom_types/structs.md)" #: src/generics/phantom/testcase_units.md:3 msgid "" "A useful method of unit conversions can be examined by implementing `Add` " "with a phantom type parameter. The `Add` `trait` is examined below:" msgstr "" -"共通の単位同士を扱う際のチェックのために、`Add`を幽霊型を用いた実装にすると便利な場合があります。" -"その場合`Add`トレイトは以下のようになります。" +"共通の単位同士を扱う際のチェックのために、`Add`を幽霊型を用いた実装にすると便" +"利な場合があります。その場合`Add`トレイトは以下のようになります。" #: src/generics/phantom/testcase_units.md:7 msgid "" @@ -8644,7 +8976,8 @@ msgstr "" #: src/generics/phantom/testcase_units.md:14 msgid "// `Output` must be `T` so that `T + T = T`.\n" -msgstr "// `Output`は`T`でなくてはならないので`T + T = T`となります。\n" +msgstr "" +"// `Output`は`T`でなくてはならないので`T + T = T`となります。\n" #: src/generics/phantom/testcase_units.md:22 msgid "The whole implementation:" @@ -8697,7 +9030,8 @@ msgid "" msgstr "" "// 以下の`+`は上で定義した`Length`用の`add()`メソッドを呼び出します。\n" " //\n" -" // `Length`は`Copy`トレイトを持っているため、`add()`は`one_foot`と`one_meter`\n" +" // `Length`は`Copy`トレイトを持っているため、`add()`は`one_foot`と" +"`one_meter`\n" " // を消費する代わりにそのコピーを作り、`self`、`rhs`として扱います。\n" #: src/generics/phantom/testcase_units.md:65 @@ -8731,10 +9065,10 @@ msgid "" "md), [Traits (`X for Y`)](../../trait.md), and [TupleStructs](../../" "custom_types/structs.md)." msgstr "" -"[借用 (`&`)](../../scope/borrow.md), [境界 (`X: Y`)](../../generics/" -"bounds.md), [列挙型](../../custom_types/enum.md), [impl & self](../../fn/" -"methods.md), [演算子のオーバーロード](../../trait/ops.md), [ref](../../scope/borrow/ref." -"md), [トレイト (`X for Y`)](../../trait.md), [タプル構造体](../../" +"[借用 (`&`)](../../scope/borrow.md), [境界 (`X: Y`)](../../generics/bounds." +"md), [列挙型](../../custom_types/enum.md), [impl & self](../../fn/methods." +"md), [演算子のオーバーロード](../../trait/ops.md), [ref](../../scope/borrow/" +"ref.md), [トレイト (`X for Y`)](../../trait.md), [タプル構造体](../../" "custom_types/structs.md)." #: src/scope.md:3 @@ -8743,10 +9077,10 @@ msgid "" "is, they indicate to the compiler when borrows are valid, when resources " "can be freed, and when variables are created or destroyed." msgstr "" -"所有権、借用、ライフタイムといったRustに特有の概念において、" -"変数のスコープは重要な役割を果たします。" -"すなわち、スコープの存在によってコンパイラは借用は可能か否か、" -"メモリ上の資源は解放可能か、変数はいつ作成され、いつ破棄されるか。といったことを知るのです。" +"所有権、借用、ライフタイムといったRustに特有の概念において、変数のスコープは" +"重要な役割を果たします。すなわち、スコープの存在によってコンパイラは借用は可" +"能か否か、メモリ上の資源は解放可能か、変数はいつ作成され、いつ破棄されるか。" +"といったことを知るのです。" #: src/scope/raii.md:3 msgid "" @@ -8756,11 +9090,12 @@ msgid "" "(Resource Acquisition Is Initialization), so whenever an object goes out of " "scope, its destructor is called and its owned resources are freed." msgstr "" -"Rustの変数は単にデータをスタック上に保持するだけのものではありません。" -"例えばヒープメモリを確保する`Box`のように、変数はメモリ上の資源を *保有* する場合もあるのです。" -"Rustは[RAII](https://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization)" -"(Resource Acquisition Is Initialization)を強制するので、" -"オブジェクトがスコープを抜けると、必ずデストラクタが呼び出されてそのオブジェクトが保持していた資源が解放されます。" +"Rustの変数は単にデータをスタック上に保持するだけのものではありません。例えば" +"ヒープメモリを確保する`Box`のように、変数はメモリ上の資源を *保有* する場" +"合もあるのです。Rustは[RAII](https://en.wikipedia.org/wiki/" +"Resource_Acquisition_Is_Initialization)(Resource Acquisition Is " +"Initialization)を強制するので、オブジェクトがスコープを抜けると、必ずデストラ" +"クタが呼び出されてそのオブジェクトが保持していた資源が解放されます。" #: src/scope/raii.md:8 msgid "" @@ -8768,9 +9103,9 @@ msgid "" "manually free memory or worry about memory leaks again! Here's a quick " "showcase:" msgstr "" -"この振る舞いは *リソースリーク* バグを防ぐのに役立ちます。" -"手動でメモリを解放したり、メモリリークバグにわずらわされたりすることはなくなるのです!" -"簡単な例で説明しましょう。" +"この振る舞いは *リソースリーク* バグを防ぐのに役立ちます。手動でメモリを解放" +"したり、メモリリークバグにわずらわされたりすることはなくなるのです!簡単な例" +"で説明しましょう。" #: src/scope/raii.md:12 msgid "// raii.rs\n" @@ -8808,7 +9143,9 @@ msgstr "// `_box2`はここで破棄され、メモリは解放されます。\n msgid "" "Of course, we can double check for memory errors using [`valgrind`](http://" "valgrind.org/info/):" -msgstr "[`valgrind`](http://valgrind.org/info/)を用いて、メモリエラーが起きていないか2重チェックすることももちろん可能です。" +msgstr "" +"[`valgrind`](http://valgrind.org/info/)を用いて、メモリエラーが起きていないか" +"2重チェックすることももちろん可能です。" #: src/scope/raii.md:65 msgid "No leaks here!" @@ -8826,11 +9163,11 @@ msgid "" "implemented for every type, only implement it for your type if you require " "its own destructor logic." msgstr "" -"Rustにおけるデストラクタの概念は[`Drop`](https://doc.rust-lang.org/std/ops/trait.Drop.html)" -"トレイトによって提供されています。" -"デストラクタは資源がスコープを抜けるときに呼び出されます。" -"`Drop`トレイトは型定義のたびに必ず実装する必要があるわけではなく、" -"デストラクタに独自のロジックが必要な場合にのみ実装します。" +"Rustにおけるデストラクタの概念は[`Drop`](https://doc.rust-lang.org/std/ops/" +"trait.Drop.html)トレイトによって提供されています。デストラクタは資源がスコー" +"プを抜けるときに呼び出されます。`Drop`トレイトは型定義のたびに必ず実装する必" +"要があるわけではなく、デストラクタに独自のロジックが必要な場合にのみ実装しま" +"す。" #: src/scope/raii.md:74 msgid "" @@ -8838,9 +9175,9 @@ msgid "" "ops/trait.Drop.html) trait works. When the variable in the `main` function " "goes out of scope the custom destructor will be invoked." msgstr "" -"下のコードを実行して、[`Drop`](https://doc.rust-lang.org/std/ops/trait.Drop.html)" -"トレイトの動作を確認してみましょう。" -"`main`関数内の変数がスコープを抜けるときにカスタムデストラクタが呼び出されるはずです。" +"下のコードを実行して、[`Drop`](https://doc.rust-lang.org/std/ops/trait.Drop." +"html)トレイトの動作を確認してみましょう。`main`関数内の変数がスコープを抜ける" +"ときにカスタムデストラクタが呼び出されるはずです。" #: src/scope/raii.md:82 msgid "\"ToDrop is being dropped\"" @@ -8861,11 +9198,11 @@ msgid "" "than once. Note that not all variables own resources (e.g. [references](../" "flow_control/match/destructuring/destructure_pointers.md))." msgstr "" -"変数には自身の保持する資源を開放する責任があるため、" -"**資源は一度に一つの所有者** しか持つことができません。" -"これはまた、資源を2度以上開放することができないということでもあります。" -"ここで、全ての変数が資源を所有するわけではないということに注意しましょう。" -"(e.g. [参照](../flow_control/match/destructuring/destructure_pointers.md))" +"変数には自身の保持する資源を開放する責任があるため、**資源は一度に一つの所有" +"者** しか持つことができません。これはまた、資源を2度以上開放することができな" +"いということでもあります。ここで、全ての変数が資源を所有するわけではないとい" +"うことに注意しましょう。(e.g. [参照](../flow_control/match/destructuring/" +"destructure_pointers.md))" #: src/scope/move.md:8 msgid "" @@ -8873,16 +9210,16 @@ msgid "" "(`foo(x)`), the _ownership_ of the resources is transferred. In Rust-speak, " "this is known as a _move_." msgstr "" -"変数を代入する(`let x = y`)際や、関数に引数を値渡しする(`foo(x)`)際は、" -"資源の *所有権* が移動します。Rustっぽく言うと、「 *ムーブ* 」です。" +"変数を代入する(`let x = y`)際や、関数に引数を値渡しする(`foo(x)`)際は、資" +"源の *所有権* が移動します。Rustっぽく言うと、「 *ムーブ* 」です。" #: src/scope/move.md:12 msgid "" "After moving resources, the previous owner can no longer be used. This " "avoids creating dangling pointers." msgstr "" -"資源を移動すると、それまでの所有者(訳注:変数などのこと)を使用することはできなくなります。" -"これによりダングリングポインタの発生を防げます。" +"資源を移動すると、それまでの所有者(訳注:変数などのこと)を使用することはで" +"きなくなります。これによりダングリングポインタの発生を防げます。" #: src/scope/move.md:16 msgid "// This function takes ownership of the heap allocated memory\n" @@ -8941,7 +9278,8 @@ msgid "" " //println!(\"a contains: {}\", a);\n" " // TODO ^ Try uncommenting this line\n" msgstr "" -"// エラー!`a`は所有権を持たないため、ヒープ上のデータにアクセスできません。\n" +"// エラー!`a`は所有権を持たないため、ヒープ上のデータにアクセスできませ" +"ん。\n" " //println!(\"a contains: {}\", a);\n" " // TODO ^ 試しにここをアンコメントしてみましょう。\n" @@ -9008,11 +9346,12 @@ msgid "" "as a whole, however the parts that are only referenced (and not moved) can " "still be used." msgstr "" -"1つの変数の [デストラクト](../../flow_control/match/destructuring.md) の中で、" -"`ムーブ` と `参照` の両方のパターン束縛を同時に使用することができます。" -"両方を使用すると、変数の一部がムーブされ、他の部分が参照として残るという変数の部分的ムーブが発生した状態になります。" -"変数の部分的ムーブが発生すると親変数はその後使用できませんが、" -"参照されているだけの部分(ムーブされていない部分)は使用することができます。" +"1つの変数の [デストラクト](../../flow_control/match/destructuring.md) の中" +"で、`ムーブ` と `参照` の両方のパターン束縛を同時に使用することができます。両" +"方を使用すると、変数の一部がムーブされ、他の部分が参照として残るという変数の" +"部分的ムーブが発生した状態になります。変数の部分的ムーブが発生すると親変数は" +"その後使用できませんが、参照されているだけの部分(ムーブされていない部分)は" +"使用することができます。" #: src/scope/move/partial_move.md:24 msgid "// `name` is moved out of person, but `age` is referenced\n" @@ -9031,7 +9370,8 @@ msgid "" "// Error! borrow of partially moved value: `person` partial move occurs\n" " //println!(\"The person struct is {:?}\", person);\n" msgstr "" -"// エラー!部分的ムーブした値の借用:`person` では部分的ムーブが発生しています。\n" +"// エラー!部分的ムーブした値の借用:`person` では部分的ムーブが発生していま" +"す。\n" " //println!(\"The person struct is {:?}\", person);\n" #: src/scope/move/partial_move.md:34 @@ -9054,11 +9394,11 @@ msgid "" "definition of `age` would copy the data from `person.age` without moving " "it.)" msgstr "" -"この例では、`age`変数をヒープ上に保持し、部分的ムーブを説明しています。" -"上記コードで`ref`を削除すると、`person.age`の所有権が`age`変数にムーブされるため、エラーになります。" -"もしも`Person.age`がスタック上に保持されていたら、" -"`age`の定義が`person.age`をムーブすることなくデータをコピーするので、" -"`ref`は必須ではないのですが、実際にはヒープ上に保持されているため`ref`は必須です。" +"この例では、`age`変数をヒープ上に保持し、部分的ムーブを説明しています。上記" +"コードで`ref`を削除すると、`person.age`の所有権が`age`変数にムーブされるた" +"め、エラーになります。もしも`Person.age`がスタック上に保持されていたら、`age`" +"の定義が`person.age`をムーブすることなくデータをコピーするので、`ref`は必須で" +"はないのですが、実際にはヒープ上に保持されているため`ref`は必須です。" #: src/scope/move/partial_move.md:46 msgid "[destructuring](../../flow_control/match/destructuring.md)" @@ -9070,9 +9410,9 @@ msgid "" "To accomplish this, Rust uses a _borrowing_ mechanism. Instead of passing " "objects by value (`T`), objects can be passed by reference (`&T`)." msgstr "" -"実際には、データの所有権を完全に受け渡すことなく一時的にアクセスしたいという場合がほとんどです。" -"そのために、Rustでは *借用* という仕組みを用います。" -"値そのもの(`T`)を受け渡すのではなく、その参照(`&T`)を渡すのです。" +"実際には、データの所有権を完全に受け渡すことなく一時的にアクセスしたいという" +"場合がほとんどです。そのために、Rustでは *借用* という仕組みを用います。値そ" +"のもの(`T`)を受け渡すのではなく、その参照(`&T`)を渡すのです。" #: src/scope/borrow.md:7 msgid "" @@ -9080,9 +9420,9 @@ msgid "" "_always_ point to valid objects. That is, while references to an object " "exist, the object cannot be destroyed." msgstr "" -"コンパイラは借用チェッカを用いて参照が *常に* 有効なオブジェクトへの参照であることを、" -"コンパイル時に保証します。つまり、あるオブジェクトへの参照が存在しているならば、" -"そのオブジェクトを破壊することはできないということです。" +"コンパイラは借用チェッカを用いて参照が *常に* 有効なオブジェクトへの参照であ" +"ることを、コンパイル時に保証します。つまり、あるオブジェクトへの参照が存在し" +"ているならば、そのオブジェクトを破壊することはできないということです。" #: src/scope/borrow.md:12 msgid "// This function takes ownership of a box and destroys it\n" @@ -9140,8 +9480,9 @@ msgstr "// ここで`_ref_to_i32`はスコープを抜け、借用もなくな #: src/scope/borrow.md:48 msgid "" -"// `boxed_i32` can now give up ownership to `eat_box` and be destroyed\n" -msgstr "// ここでようやく、`eat_box`は所有権を移譲し、破棄することができます。\n" +"// `boxed_i32` can now give up ownership to `eat_box_32` and be destroyed\n" +msgstr "" +"// ここでようやく、`boxed_i32`は所有権を`eat_box_32`に移譲し、破棄することができます。\n" #: src/scope/borrow/mut.md:3 msgid "" @@ -9150,9 +9491,9 @@ msgid "" "contrast, `&T` borrows the data via an immutable reference, and the " "borrower can read the data but not modify it:" msgstr "" -"ミュータブルなデータは`&mut T`でミュータブルに(変更可能な形で)借用することができます。" -"これは *ミュータブルな参照* と呼ばれ、読み込み・書き込みの権限を借用者に与えます。" -"対照的に`&T`はデータをイミュータブルな参照を介して借用し、" +"ミュータブルなデータは`&mut T`でミュータブルに(変更可能な形で)借用すること" +"ができます。これは *ミュータブルな参照* と呼ばれ、読み込み・書き込みの権限を" +"借用者に与えます。対照的に`&T`はデータをイミュータブルな参照を介して借用し、" "借用した側はデータを読み込みはできますが書き込みはできません。" #: src/scope/borrow/mut.md:12 @@ -9198,7 +9539,8 @@ msgstr "\"Gödel, Escher, Bach\"" #: src/scope/borrow/mut.md:38 msgid "// Create a mutable copy of `immutabook` and call it `mutabook`\n" -msgstr "// `immutabook`のミュータブルなコピーを作成し、`mutabook`と名付けます。\n" +msgstr "" +"// `immutabook`のミュータブルなコピーを作成し、`mutabook`と名付けます。\n" #: src/scope/borrow/mut.md:41 msgid "// Immutably borrow an immutable object\n" @@ -9214,7 +9556,8 @@ msgstr "// ミュータブルなオブジェクトをミュータブルに借用 #: src/scope/borrow/mut.md:50 msgid "// Error! Cannot borrow an immutable object as mutable\n" -msgstr "// エラー!イミュータブルなオブジェクトをミュータブルに借用できません。\n" +msgstr "" +"// エラー!イミュータブルなオブジェクトをミュータブルに借用できません。\n" #: src/scope/borrow/mut.md:57 msgid "[`static`](../lifetime/static_lifetime.md)" @@ -9228,10 +9571,11 @@ msgid "" "borrowed again only _after_ the mutable reference has been used for the last " "time." msgstr "" -"データは一度にいくつでもイミュータブルに借用することができますが、" -"その間オリジナルのデータをミュータブルに借用することはできません。" -"一方でミュータブルな借用は一度に *一つ* しか借用することができません。" -"オリジナルのデータをもう一度借用できるのはミュータブルな参照が最後に使われた場所より *あとで* なければいけません。" +"データは一度にいくつでもイミュータブルに借用することができますが、その間オリ" +"ジナルのデータをミュータブルに借用することはできません。一方でミュータブルな" +"借用は一度に *一つ* しか借用することができません。オリジナルのデータをもう一" +"度借用できるのはミュータブルな参照が最後に使われた場所より *あとで* なければ" +"いけません。" #: src/scope/borrow/alias.md:17 msgid "// Data can be accessed via the references and the original owner\n" @@ -9294,13 +9638,15 @@ msgstr "" #: src/scope/borrow/alias.md:48 msgid "// Ok! Mutable references can be passed as immutable to `println!`\n" -msgstr "// OK!ミュータブルな参照は`println!`にイミュータブルな参照として渡せます。\n" +msgstr "" +"// OK!ミュータブルな参照は`println!`にイミュータブルな参照として渡せます。\n" #: src/scope/borrow/alias.md:52 msgid "" "// The mutable reference is no longer used for the rest of the code so it\n" " // is possible to reborrow\n" -msgstr "// ミュータブルな参照がこれ以降のコードで未使用なので、再借用できます。\n" +msgstr "" +"// ミュータブルな参照がこれ以降のコードで未使用なので、再借用できます。\n" #: src/scope/borrow/alias.md:55 msgid "\"Point now has coordinates: ({}, {}, {})\"" @@ -9312,15 +9658,17 @@ msgid "" "`ref` keyword can be used to take references to the fields of a struct/" "tuple. The example below shows a few instances where this can be useful:" msgstr "" -"`let`を介してデストラクトやパターンマッチングを行う場合、" -"`ref`キーワードを用いて構造体・タプルのフィールドへの参照を取得することができます。" -"以下の例ではこれが有用になる例を幾つかお見せします。" +"`let`を介してデストラクトやパターンマッチングを行う場合、`ref`キーワードを用" +"いて構造体・タプルのフィールドへの参照を取得することができます。以下の例では" +"これが有用になる例を幾つかお見せします。" #: src/scope/borrow/ref.md:14 msgid "" "// A `ref` borrow on the left side of an assignment is equivalent to\n" " // an `&` borrow on the right side.\n" -msgstr "// 左辺に`ref`をつけることによる借用と、右辺に`&`をつけることによる借用は等価。\n" +msgstr "" +"// 左辺に`ref`をつけることによる借用と、右辺に`&`をつけることによる借用は等" +"価。\n" #: src/scope/borrow/ref.md:19 msgid "\"ref_c1 equals ref_c2: {}\"" @@ -9344,11 +9692,13 @@ msgstr "// `point`へのミュータブルなコピー\n" #: src/scope/borrow/ref.md:36 msgid "// `ref` can be paired with `mut` to take mutable references.\n" -msgstr "// `ref`は`mut`とともに使い、ミュータブルな参照を取ることもできます。\n" +msgstr "" +"// `ref`は`mut`とともに使い、ミュータブルな参照を取ることもできます。\n" #: src/scope/borrow/ref.md:39 msgid "// Mutate the `y` field of `mutable_point` via a mutable reference.\n" -msgstr "// `mutable_point`の`y`というミュータブルなフィールドの値を変更します。\n" +msgstr "" +"// `mutable_point`の`y`というミュータブルなフィールドの値を変更します。\n" #: src/scope/borrow/ref.md:43 msgid "\"point is ({}, {})\"" @@ -9377,10 +9727,10 @@ msgid "" "lifetime begins when it is created and ends when it is destroyed. While " "lifetimes and scopes are often referred to together, they are not the same." msgstr "" -"*ライフタイム* はコンパイラ(借用チェッカーと呼ばれる場合もあります)が、" -"全ての借用に問題がないことを確認するために使用する仕組みです。" -"正確にいうと、変数のライフタイムは作成時に開始し、破棄された時に終了します。" -"ライフタイムとスコープは同時に語られることが多いですが、同じものではありません。" +"*ライフタイム* はコンパイラ(借用チェッカーと呼ばれる場合もあります)が、全て" +"の借用に問題がないことを確認するために使用する仕組みです。正確にいうと、変数" +"のライフタイムは作成時に開始し、破棄された時に終了します。ライフタイムとス" +"コープは同時に語られることが多いですが、同じものではありません。" #: src/scope/lifetime.md:8 msgid "" @@ -9389,17 +9739,17 @@ msgid "" "borrow is valid as long as it ends before the lender is destroyed. However, " "the scope of the borrow is determined by where the reference is used." msgstr "" -"例として`&`を用いて変数を借用する場合をあげましょう。" -"借用のライフタイムは宣言時に決定し、そこから貸し手が破棄されるまで続きます。" -"しかしながら、借用のスコープは参照が使われる際に決定します。" +"例として`&`を用いて変数を借用する場合をあげましょう。借用のライフタイムは宣言" +"時に決定し、そこから貸し手が破棄されるまで続きます。しかしながら、借用のス" +"コープは参照が使われる際に決定します。" #: src/scope/lifetime.md:13 msgid "" "In the following example and in the rest of this section, we will see how " "lifetimes relate to scopes, as well as how the two differ." msgstr "" -"以下の例からこのセクションの残りでは、ライフタイムとスコープの関係、" -"そしてそれらがいかに異なるものであるかを見ていきます。" +"以下の例からこのセクションの残りでは、ライフタイムとスコープの関係、そしてそ" +"れらがいかに異なるものであるかを見ていきます。" #: src/scope/lifetime.md:17 msgid "" @@ -9482,7 +9832,8 @@ msgid "" "how lifetimes will be able to be used as we will see." msgstr "" "ここで、一切の名前や型がライフタイムに代入されていないことに注意しましょう。" -"これにより、ライフタイムの使われ方がこれから見ていくようなやり方に制限されます。" +"これにより、ライフタイムの使われ方がこれから見ていくようなやり方に制限されま" +"す。" #: src/scope/lifetime/explicit.md:3 msgid "" @@ -9492,9 +9843,9 @@ msgid "" "reference should be. The syntax for explicitly annotating a lifetime uses " "an apostrophe character as follows: " msgstr "" -"借用チェッカーは参照がどれだけの間有効かを決定するために、明示的なアノテーションを使用します。" -"ライフタイムが省略[^1]されなかった場合、Rustは参照のライフタイムがどのようなものであるか、" -"明示的なアノテーションを必要とします。" +"借用チェッカーは参照がどれだけの間有効かを決定するために、明示的なアノテー" +"ションを使用します。ライフタイムが省略[^1]されなかった場合、Rustは参照のライ" +"フタイムがどのようなものであるか、明示的なアノテーションを必要とします。" #: src/scope/lifetime/explicit.md:10 msgid "// `foo` has a lifetime parameter `'a`\n" @@ -9507,9 +9858,10 @@ msgid "" "lifetime of `foo` may not exceed that of `'a`. Explicit annotation of a " "type has the form `&'a T` where `'a` has already been introduced." msgstr "" -"[クロージャ](../../fn/closures/anonymity.md)と同様、ライフタイムの使用はジェネリクスを必要とします。" -"もう少し詳しく言うと、この書き方は「`foo`のライフタイムは`'a`のそれを超えることはない。」" -"ということを示しており、型を明示した場合`'a`は`&'a T`となるということです。" +"[クロージャ](../../fn/closures/anonymity.md)と同様、ライフタイムの使用はジェ" +"ネリクスを必要とします。もう少し詳しく言うと、この書き方は「`foo`のライフタイ" +"ムは`'a`のそれを超えることはない。」ということを示しており、型を明示した場合" +"`'a`は`&'a T`となるということです。" #: src/scope/lifetime/explicit.md:19 msgid "In cases with multiple lifetimes, the syntax is similar:" @@ -9523,7 +9875,9 @@ msgstr "// `foo`は`'a`と`'b`というライフタイムパラメータを持 msgid "" "In this case, the lifetime of `foo` cannot exceed that of either `'a` _or_ " "`'b`." -msgstr "この場合は、`foo`のライフタイムは`'a`、`'b`の *いずれよりも* 長くなってはなりません。" +msgstr "" +"この場合は、`foo`のライフタイムは`'a`、`'b`の *いずれよりも* 長くなってはなり" +"ません。" #: src/scope/lifetime/explicit.md:28 msgid "See the following example for explicit lifetime annotation in use:" @@ -9561,7 +9915,8 @@ msgid "" "one.\n" msgstr "" "// `&_x`のライフタイムは`y`のそれよりも短いため、関数内で`'a`を使用して\n" -" // 変数のライフタイムを指定しようとすると失敗します。つまり、短いライフタイム\n" +" // 変数のライフタイムを指定しようとすると失敗します。つまり、短いライフタ" +"イム\n" " // を持つ参照をより長いものに強制的に代入することはできません。\n" #: src/scope/lifetime/explicit.md:50 @@ -9589,14 +9944,16 @@ msgid "" " // Because the lifetime is never constrained, it defaults to `'static`.\n" msgstr "" "// `failed_borrow`は関数のライフタイムよりも`'a`を長くさせるような\n" -" // 参照を持ちませんが、それでも`'a`のほうが長くなります。なぜならそのような\n" +" // 参照を持ちませんが、それでも`'a`のほうが長くなります。なぜならそのよう" +"な\n" " // 場合`'a`はデフォルトで`'static`になるからです。\n" #: src/scope/lifetime/explicit.md:66 msgid "" "[elision](elision.md) implicitly annotates lifetimes and so is different." msgstr "" -"[省略](elision.md) はライフタイムが暗黙のうちに(プログラマから見えない形で)アノテートされることを指します。" +"[省略](elision.md) はライフタイムが暗黙のうちに(プログラマから見えない形で)" +"アノテートされることを指します。" #: src/scope/lifetime/explicit.md:70 msgid "[generics](../../generics.md) and [closures](../../fn/closures.md)" @@ -9607,7 +9964,8 @@ msgid "" "Ignoring [elision](elision.md), function signatures with lifetimes have a " "few constraints: " msgstr "" -"[省略](elision.md)をしない場合、ライフタイムのシグネチャ(e.g. `<'a>`)を持つ関数にはいくつかの制限があります。" +"[省略](elision.md)をしない場合、ライフタイムのシグネチャ(e.g. `<'a>`)を持つ" +"関数にはいくつかの制限があります。" #: src/scope/lifetime/fn.md:5 msgid "any reference _must_ have an annotated lifetime." @@ -9617,7 +9975,9 @@ msgstr "全ての参照においてライフタイムを明示しなくてはな msgid "" "any reference being returned _must_ have the same lifetime as an input or be " "`static`." -msgstr "返り値となる参照はすべて引数と同じライフタイムか、`static`ライフタイムを持たなくてはなりません" +msgstr "" +"返り値となる参照はすべて引数と同じライフタイムか、`static`ライフタイムを持た" +"なくてはなりません" #: src/scope/lifetime/fn.md:9 msgid "" @@ -9625,8 +9985,9 @@ msgid "" "would result in returning references to invalid data. The following example " "shows off some valid forms of functions with lifetimes:" msgstr "" -"加えて、引数のない関数から参照を返すことは、それが結果的に無効なデータへの参照になるならば、禁止されています。" -"ライフタイムを持つ関数の例をいくつか示します。" +"加えて、引数のない関数から参照を返すことは、それが結果的に無効なデータへの参" +"照になるならば、禁止されています。ライフタイムを持つ関数の例をいくつか示しま" +"す。" #: src/scope/lifetime/fn.md:14 msgid "" @@ -9675,7 +10036,8 @@ msgid "" "// a reference to invalid data to be returned.\n" msgstr "" "// `'a`は関数より長くなくてはならないため上の関数は正しくありません。\n" -"// ここでは、`&String::from(\"foo\")`は`String`のデータとそれへの参照を作ります。\n" +"// ここでは、`&String::from(\"foo\")`は`String`のデータとそれへの参照を作りま" +"す。\n" "// その後データはスコープを抜けるとともに破棄されます。そのため、\n" "// 不適切なデータに対する参照を返すことになってしまいます。\n" @@ -9740,9 +10102,9 @@ msgid "" "Annotation of lifetimes in trait methods basically are similar to functions. " "Note that `impl` may have annotation of lifetimes too." msgstr "" -"トレイトのメソッドにおけるライフタイムのアノテーションは、" -"基本的には関数に似ています。" -"`impl`にもライフタイムのアノテーションがあることに注意してください。" +"トレイトのメソッドにおけるライフタイムのアノテーションは、基本的には関数に似" +"ています。`impl`にもライフタイムのアノテーションがあることに注意してくださ" +"い。" #: src/scope/lifetime/trait.md:7 msgid "// A struct with annotation of lifetimes.\n" @@ -9766,9 +10128,10 @@ msgid "" "bounds as well. The `:` character has a slightly different meaning here, " "but `+` is the same. Note how the following read:" msgstr "" -"ジェネリック型に境界を与え、特定のトレイトを実装していることを保証できるのと同様、" -"ライフタイム(それ自身ジェネリック型)にも境界を与えることができます。" -"`:`は、ここでは多少異なる意味を持ちますが`+`は同じです。以下の構文の意味をチェックしてください。" +"ジェネリック型に境界を与え、特定のトレイトを実装していることを保証できるのと" +"同様、ライフタイム(それ自身ジェネリック型)にも境界を与えることができます。" +"`:`は、ここでは多少異なる意味を持ちますが`+`は同じです。以下の構文の意味を" +"チェックしてください。" #: src/scope/lifetime/lifetime_bounds.md:7 msgid "`T: 'a`: _All_ references in `T` must outlive lifetime `'a`." @@ -9778,13 +10141,17 @@ msgstr "`T: 'a`:`T`内の *全ての* 参照は`'a`よりも長生きでなく msgid "" "`T: Trait + 'a`: Type `T` must implement trait `Trait` and _all_ references " "in `T` must outlive `'a`." -msgstr "`T: Trait + 'a`:上に加えて`T`は`Trait`という名のトレイトを実装してなくてはなりません。" +msgstr "" +"`T: Trait + 'a`:上に加えて`T`は`Trait`という名のトレイトを実装してなくてはな" +"りません。" #: src/scope/lifetime/lifetime_bounds.md:11 msgid "" "The example below shows the above syntax in action used after keyword " "`where`:" -msgstr "上記の構文を実際に動く例で見ていきましょう。`where`キーワードの後に注目してください。" +msgstr "" +"上記の構文を実際に動く例で見ていきましょう。`where`キーワードの後に注目してく" +"ださい。" #: src/scope/lifetime/lifetime_bounds.md:14 msgid "// Trait to bound with.\n" @@ -9838,8 +10205,9 @@ msgid "" "coercion by the Rust compiler, and also in the form of declaring a lifetime " "difference:" msgstr "" -"長いライフタイムは、短いものに圧縮することで、そのままでは動作しないスコープの中でも使用できるようになります。" -"これは、Rustコンパイラが推論の結果として圧縮する場合と、複数のライフタイムを比較して圧縮する場合があります。" +"長いライフタイムは、短いものに圧縮することで、そのままでは動作しないスコープ" +"の中でも使用できるようになります。これは、Rustコンパイラが推論の結果として圧" +"縮する場合と、複数のライフタイムを比較して圧縮する場合があります。" #: src/scope/lifetime/lifetime_coercion.md:9 msgid "" @@ -9879,8 +10247,8 @@ msgid "" "Rust has a few reserved lifetime names. One of those is `'static`. You might " "encounter it in two situations:" msgstr "" -"Rustにはいくつかの予約されたライフタイム名があります。" -"その1つが`static`で、2つの状況で使用することがあります。" +"Rustにはいくつかの予約されたライフタイム名があります。その1つが`static`で、2" +"つの状況で使用することがあります。" #: src/scope/lifetime/static_lifetime.md:7 msgid "// A reference with 'static lifetime:\n" @@ -9899,8 +10267,8 @@ msgid "" "Both are related but subtly different and this is a common source for " "confusion when learning Rust. Here are some examples for each situation:" msgstr "" -"2つの状況における`static`は微妙に異なる意味を持っており、Rustを学ぶときの混乱の元になっています。" -"いくつかの例とともにそれぞれの使い方を見てみましょう。" +"2つの状況における`static`は微妙に異なる意味を持っており、Rustを学ぶときの混乱" +"の元になっています。いくつかの例とともにそれぞれの使い方を見てみましょう。" #: src/scope/lifetime/static_lifetime.md:17 msgid "Reference lifetime" @@ -9912,16 +10280,17 @@ msgid "" "reference lives for the remaining lifetime of the running program. It can " "still be coerced to a shorter lifetime." msgstr "" -"参照のライフタイムが`'static`であることは、参照が指し示す値がプログラムの実行中に渡って生き続けることを示します。" -"また、より短いライフタイムに圧縮することも可能です。" +"参照のライフタイムが`'static`であることは、参照が指し示す値がプログラムの実行" +"中に渡って生き続けることを示します。また、より短いライフタイムに圧縮すること" +"も可能です。" #: src/scope/lifetime/static_lifetime.md:23 msgid "" "There are two common ways to make a variable with `'static` lifetime, and " "both are stored in the read-only memory of the binary:" msgstr "" -"`'static`ライフタイムを持つ変数を作るには下記の2つ方法があります。" -"どちらの場合も、値は読み取り専用のメモリ領域に格納されます。" +"`'static`ライフタイムを持つ変数を作るには下記の2つ方法があります。どちらの場" +"合も、値は読み取り専用のメモリ領域に格納されます。" #: src/scope/lifetime/static_lifetime.md:26 msgid "Make a constant with the `static` declaration." @@ -10003,9 +10372,9 @@ msgid "" "references. Eg. the receiver can hold on to the type for as long as they " "want and it will never become invalid until they drop it." msgstr "" -"トレイト境界としての`'static`は型が非静的な参照を含まないことを意味します。" -"言い換えると、レシーバはその型をいくらでも長く保持することができ、" -"意図的にドロップするまでは決して無効になることはないということです。" +"トレイト境界としての`'static`は型が非静的な参照を含まないことを意味します。言" +"い換えると、レシーバはその型をいくらでも長く保持することができ、意図的にド" +"ロップするまでは決して無効になることはないということです。" #: src/scope/lifetime/static_lifetime.md:96 msgid "" @@ -10013,8 +10382,9 @@ msgid "" "`'static` lifetime bound, but a reference to that owned data generally does " "not:" msgstr "" -"次のポイントを押さえておきましょう。所有権のある値が`'static`ライフタイム境界をパスするとしても、" -"その値への参照が`'static`ライフタイム境界をパスするとは限りません。" +"次のポイントを押さえておきましょう。所有権のある値が`'static`ライフタイム境界" +"をパスするとしても、その値への参照が`'static`ライフタイム境界をパスするとは限" +"りません。" #: src/scope/lifetime/static_lifetime.md:104 msgid "\"'static value passed in is: {:?}\"" @@ -10047,9 +10417,10 @@ msgid "" "is known as elision. Elision exists in Rust solely because these patterns " "are common." msgstr "" -"ライフタイムのパターンのうちのいくつかは、他と比べてあまりにも一般的に使用されるため、" -"タイプ量を減らし可読性を上げるために省くことができます。" -"これは省略として知られており、それらのパターンが一般的であるというだけの理由で存在しています。" +"ライフタイムのパターンのうちのいくつかは、他と比べてあまりにも一般的に使用さ" +"れるため、タイプ量を減らし可読性を上げるために省くことができます。これは省略" +"として知られており、それらのパターンが一般的であるというだけの理由で存在して" +"います。" #: src/scope/lifetime/elision.md:8 msgid "" @@ -10057,9 +10428,9 @@ msgid "" "description of elision, see [lifetime elision](https://doc.rust-lang.org/" "book/ch10-03-lifetime-syntax.html#lifetime-elision) in the book." msgstr "" -"以下のコードでは省略の例を幾つかお見せします。" -"より完全な説明を見たい場合は、「プログラミング言語Rust」の" -"[ライフタイムの省略](https://doc.rust-lang.org/book/ch10-03-lifetime-syntax.html#lifetime-elision)の項を見てください。" +"以下のコードでは省略の例を幾つかお見せします。より完全な説明を見たい場合は、" +"「プログラミング言語Rust」の[ライフタイムの省略](https://doc.rust-lang.org/" +"book/ch10-03-lifetime-syntax.html#lifetime-elision)の項を見てください。" #: src/scope/lifetime/elision.md:12 msgid "" @@ -10082,7 +10453,8 @@ msgstr "\"`annotated_input`: {}\"" msgid "" "// Similarly, `elided_pass` and `annotated_pass` have identical signatures\n" "// because the lifetime is added implicitly to `elided_pass`:\n" -msgstr "// 同様に、以下の2つの関数も全く同じライフタイムシグネチャを持ちます。\n" +msgstr "" +"// 同様に、以下の2つの関数も全く同じライフタイムシグネチャを持ちます。\n" #: src/scope/lifetime/elision.md:34 msgid "\"`elided_pass`: {}\"" @@ -10097,16 +10469,17 @@ msgid "" "[elision](https://doc.rust-lang.org/book/ch10-03-lifetime-syntax." "html#lifetime-elision)" msgstr "" -"[省略](https://doc.rust-lang.org/book/ch10-03-lifetime-syntax." -"html#lifetime-elision)" +"[省略](https://doc.rust-lang.org/book/ch10-03-lifetime-syntax.html#lifetime-" +"elision)" #: src/trait.md:3 msgid "" "A `trait` is a collection of methods defined for an unknown type: `Self`. " "They can access other methods declared in the same trait." msgstr "" -"トレイトとは任意の型となりうる`Self`に対して定義されたメソッドの集合のことです。" -"同じトレイト内で宣言されたメソッド同士はお互いにアクセスすることができます。" +"トレイトとは任意の型となりうる`Self`に対して定義されたメソッドの集合のことで" +"す。同じトレイト内で宣言されたメソッド同士はお互いにアクセスすることができま" +"す。" #: src/trait.md:6 msgid "" @@ -10115,10 +10488,10 @@ msgid "" "the `Sheep` data type, allowing the use of methods from `Animal` with a " "`Sheep`." msgstr "" -"トレイトはあらゆるデータ型に実装することができます。" -"以下の例ではまず`Animal`というメソッドの集合を定義し、" -"その後`Animal`トレイトを`Sheep`というデータ型に対して実装します。" -"これにより`Animal`のメソッドを`Sheep`が使用することが可能になります。" +"トレイトはあらゆるデータ型に実装することができます。以下の例ではまず`Animal`" +"というメソッドの集合を定義し、その後`Animal`トレイトを`Sheep`というデータ型に" +"対して実装します。これにより`Animal`のメソッドを`Sheep`が使用することが可能に" +"なります。" #: src/trait.md:15 msgid "" @@ -10201,9 +10574,9 @@ msgid "" "via the `#[derive]` [attribute](../attribute.md). These traits can still be " "manually implemented if a more complex behavior is required." msgstr "" -"コンパイラには、`#[derive]`[アトリビュート](../attribute.md)を用いることで型に対して" -"特定のトレイトの標準的な実装を提供する機能があります。" -"より複雑なことを行わせたい場合には、同名のトレイトを手動で実装することも可能です。" +"コンパイラには、`#[derive]`[アトリビュート](../attribute.md)を用いることで型" +"に対して特定のトレイトの標準的な実装を提供する機能があります。より複雑なこと" +"を行わせたい場合には、同名のトレイトを手動で実装することも可能です。" #: src/trait/derive.md:7 msgid "The following is a list of derivable traits:" @@ -10216,50 +10589,50 @@ msgid "" "[`Ord`](https://doc.rust-lang.org/std/cmp/trait.Ord.html), [`PartialOrd`]" "(https://doc.rust-lang.org/std/cmp/trait.PartialOrd.html)." msgstr "" -"型の比較に関連するトレイト: [`Eq`](https://doc.rust-lang.org/std/cmp/trait.Eq.html), " -"[`PartialEq`](https://doc.rust-lang.org/std/cmp/trait.PartialEq.html), " -"[`Ord`](https://doc.rust-lang.org/std/cmp/trait.Ord.html), [`PartialOrd`]" -"(https://doc.rust-lang.org/std/cmp/trait.PartialOrd.html)." +"型の比較に関連するトレイト: [`Eq`](https://doc.rust-lang.org/std/cmp/trait." +"Eq.html), [`PartialEq`](https://doc.rust-lang.org/std/cmp/trait.PartialEq." +"html), [`Ord`](https://doc.rust-lang.org/std/cmp/trait.Ord.html), " +"[`PartialOrd`](https://doc.rust-lang.org/std/cmp/trait.PartialOrd.html)." #: src/trait/derive.md:10 msgid "" "[`Clone`](https://doc.rust-lang.org/std/clone/trait.Clone.html), to create " "`T` from `&T` via a copy." msgstr "" -"[`Clone`](https://doc.rust-lang.org/std/clone/trait.Clone.html):" -"これはコピーによって`&T`から`T`を作成するトレイト" +"[`Clone`](https://doc.rust-lang.org/std/clone/trait.Clone.html):これはコピー" +"によって`&T`から`T`を作成するトレイト" #: src/trait/derive.md:11 msgid "" "[`Copy`](https://doc.rust-lang.org/core/marker/trait.Copy.html), to give a " "type 'copy semantics' instead of 'move semantics'." msgstr "" -"[`Copy`](https://doc.rust-lang.org/core/marker/trait.Copy.html):" -"これはムーブセマンティクスの代わりにコピーセマンティクスにするためのトレイト" +"[`Copy`](https://doc.rust-lang.org/core/marker/trait.Copy.html):これはムーブ" +"セマンティクスの代わりにコピーセマンティクスにするためのトレイト" #: src/trait/derive.md:12 msgid "" "[`Hash`](https://doc.rust-lang.org/std/hash/trait.Hash.html), to compute a " "hash from `&T`." msgstr "" -"[`Hash`](https://doc.rust-lang.org/std/hash/trait.Hash.html):" -"これは`&T`からハッシュ値を計算するためのトレイト" +"[`Hash`](https://doc.rust-lang.org/std/hash/trait.Hash.html):これは`&T`から" +"ハッシュ値を計算するためのトレイト" #: src/trait/derive.md:13 msgid "" "[`Default`](https://doc.rust-lang.org/std/default/trait.Default.html), to " "create an empty instance of a data type." msgstr "" -"[`Default`](https://doc.rust-lang.org/std/default/trait.Default.html):" -"これは空っぽのインスタンスを作成するためのトレイト" +"[`Default`](https://doc.rust-lang.org/std/default/trait.Default.html):これは" +"空っぽのインスタンスを作成するためのトレイト" #: src/trait/derive.md:14 msgid "" "[`Debug`](https://doc.rust-lang.org/std/fmt/trait.Debug.html), to format a " "value using the `{:?}` formatter." msgstr "" -"[`Debug`](https://doc.rust-lang.org/std/fmt/trait.Debug.html):" -"これは`{:?}`フォーマッタを利用して値をフォーマットするためのトレイト" +"[`Debug`](https://doc.rust-lang.org/std/fmt/trait.Debug.html):これは`{:?}`" +"フォーマッタを利用して値をフォーマットするためのトレイト" #: src/trait/derive.md:17 msgid "// `Centimeters`, a tuple struct that can be compared\n" @@ -10323,10 +10696,11 @@ msgid "" "function that returns `Animal`, because its different implementations will " "need different amounts of memory. " msgstr "" -"Rustのコンパイラはあらゆる関数のリターン型に必要なスペースを知っておく必要があります。" -"つまり、すべての関数は具体的な型を返す必要があるのです。" -"他の言語と違って、`Animal`のようなトレイトがある場合に、`Animal`を返す関数を書くことはできません。" -"なぜなら、そのトレイトの異なる実装はそれぞれ別の量のメモリを必要とするからです。" +"Rustのコンパイラはあらゆる関数のリターン型に必要なスペースを知っておく必要が" +"あります。つまり、すべての関数は具体的な型を返す必要があるのです。他の言語と" +"違って、`Animal`のようなトレイトがある場合に、`Animal`を返す関数を書くことは" +"できません。なぜなら、そのトレイトの異なる実装はそれぞれ別の量のメモリを必要" +"とするからです。" #: src/trait/dyn.md:5 msgid "" @@ -10336,11 +10710,11 @@ msgid "" "has a statically-known size, and the compiler can guarantee it points to a " "heap-allocated `Animal`, we can return a trait from our function!" msgstr "" -"しかし、簡単な回避策があります。" -"直接トレイトオブジェクトを返す代わりに、`Animal`を _含む_ `Box`を返すのです。" -"`Box`はヒープ中のメモリへの単なる参照です。" -"参照のサイズは静的に知ることができ、コンパイラは参照がヒープに割り当てられた`Animal`を指していると保証できるので、" -"私たちは関数からトレイトを返すことができます。" +"しかし、簡単な回避策があります。直接トレイトオブジェクトを返す代わりに、" +"`Animal`を _含む_ `Box`を返すのです。`Box`はヒープ中のメモリへの単なる参照で" +"す。参照のサイズは静的に知ることができ、コンパイラは参照がヒープに割り当てら" +"れた`Animal`を指していると保証できるので、私たちは関数からトレイトを返すこと" +"ができます。" #: src/trait/dyn.md:7 msgid "" @@ -10349,9 +10723,10 @@ msgid "" "you need to write the return type with the `dyn` keyword, e.g. `Box`." msgstr "" -"ヒープにメモリを割り当てる際、Rustは可能な限り明示的であろうとします。" -"なので、もしあなたの関数がヒープ上のトレイトへのポインタを返す場合、" -"例えば`Box`のように、リターン型に`dyn`キーワードをつける必要があります。" +"ヒープにメモリを割り当てる際、Rustは可能な限り明示的であろうとします。なの" +"で、もしあなたの関数がヒープ上のトレイトへのポインタを返す場合、例えば" +"`Box`のように、リターン型に`dyn`キーワードをつける必要がありま" +"す。" #: src/trait/dyn.md:14 msgid "// Instance method signature\n" @@ -10386,20 +10761,20 @@ msgid "" "in `a.add(b)`). This `add` method is part of the `Add` trait. Hence, the `+` " "operator can be used by any implementor of the `Add` trait." msgstr "" -"Rustでは、多くの演算子はトレイトによってオーバーロードすることができます。" -"つまり、一部の演算子は引数となる値の型に応じて異なる役割を果たすことができるということです。" -"これが可能なのは、演算子が実際にはメソッド呼び出しの糖衣構文にすぎないからです。" -"例えば`a + b`における`+`演算子は`add`メソッドを(`a.add(b)`の形で)呼び出します。" -"この`add`メソッドは`Add`トレイトの一部です。" -"それ故、`+`は`Add`トレイトを実装している全ての型に対して有効なのです。" +"Rustでは、多くの演算子はトレイトによってオーバーロードすることができます。つ" +"まり、一部の演算子は引数となる値の型に応じて異なる役割を果たすことができると" +"いうことです。これが可能なのは、演算子が実際にはメソッド呼び出しの糖衣構文に" +"すぎないからです。例えば`a + b`における`+`演算子は`add`メソッドを(`a.add(b)`" +"の形で)呼び出します。この`add`メソッドは`Add`トレイトの一部です。それ故、`+`" +"は`Add`トレイトを実装している全ての型に対して有効なのです。" #: src/trait/ops.md:9 msgid "" "A list of the traits, such as `Add`, that overload operators can be found in " "[`core::ops`](https://doc.rust-lang.org/core/ops/)." msgstr "" -"`Add`などの、演算子をオーバーロードするトレイトの一覧は" -"[`core::ops`](https://doc.rust-lang.org/core/ops/)にあります。" +"`Add`などの、演算子をオーバーロードするトレイトの一覧は[`core::ops`](https://" +"doc.rust-lang.org/core/ops/)にあります。" #: src/trait/ops.md:22 msgid "" @@ -10461,9 +10836,10 @@ msgid "" "out of scope. The main use of the `Drop` trait is to free the resources that " "the implementor instance owns." msgstr "" -"[`Drop`](https://doc.rust-lang.org/std/ops/trait.Drop.html)トレイトにはメソッドが一つだけしかありません。" -"`drop`です。これは、オブジェクトがスコープから抜けた時に自動で呼ばれます。" -"`Drop`トレイトの主な使用目的は、インスタンスが所有する資源を開放することです。" +"[`Drop`](https://doc.rust-lang.org/std/ops/trait.Drop.html)トレイトにはメソッ" +"ドが一つだけしかありません。`drop`です。これは、オブジェクトがスコープから抜" +"けた時に自動で呼ばれます。`Drop`トレイトの主な使用目的は、インスタンスが所有" +"する資源を開放することです。" #: src/trait/drop.md:7 msgid "" @@ -10471,16 +10847,17 @@ msgid "" "that implement the `Drop` trait to free resources. The `Drop` trait can also " "be manually implemented for any custom data type." msgstr "" -"`Drop`トレイトを実装している型の例としては`Box`、`Vec`、`String`、`File`、`Process`等があげられます。" -"`Drop`トレイトは任意の型に対して手動で実装することができます。" +"`Drop`トレイトを実装している型の例としては`Box`、`Vec`、`String`、`File`、" +"`Process`等があげられます。`Drop`トレイトは任意の型に対して手動で実装すること" +"ができます。" #: src/trait/drop.md:11 msgid "" "The following example adds a print to console to the `drop` function to " "announce when it is called." msgstr "" -"以下の例では`drop`メソッドにコンソールへの出力を追加することで、" -"`drop`が呼ばれたタイミングが分かるようにしています。" +"以下の例では`drop`メソッドにコンソールへの出力を追加することで、`drop`が呼ば" +"れたタイミングが分かるようにしています。" #: src/trait/drop.md:18 msgid "// This trivial implementation of `drop` adds a print to console.\n" @@ -10556,8 +10933,9 @@ msgid "" "The [`Iterator`](https://doc.rust-lang.org/core/iter/trait.Iterator.html) " "trait is used to implement iterators over collections such as arrays." msgstr "" -"[`Iterator`](https://doc.rust-lang.org/core/iter/trait.Iterator.html)" -"トレイトは、例えば配列のような、要素の集合に対してイテレータを実装するためのトレイトです。" +"[`Iterator`](https://doc.rust-lang.org/core/iter/trait.Iterator.html)トレイト" +"は、例えば配列のような、要素の集合に対してイテレータを実装するためのトレイト" +"です。" #: src/trait/iter.md:6 msgid "" @@ -10565,8 +10943,9 @@ msgid "" "may be manually defined in an `impl` block or automatically defined (as in " "arrays and ranges)." msgstr "" -"このトレイトは`next`の要素に相当するものを決定するためのメソッドのみを要求します。" -"このメソッドは`impl`ブロック内で手動で実装するか、あるいは(配列やrangeのように)自動で定義されます。" +"このトレイトは`next`の要素に相当するものを決定するためのメソッドのみを要求し" +"ます。このメソッドは`impl`ブロック内で手動で実装するか、あるいは(配列やrange" +"のように)自動で定義されます。" #: src/trait/iter.md:10 msgid "" @@ -10574,8 +10953,9 @@ msgid "" "some collections into iterators using the [`.into_iter()`](https://doc.rust-" "lang.org/std/iter/trait.IntoIterator.html) method." msgstr "" -"サッとイテレータを使いたい時は、`for`文で集合からイテレータを作成することが良くあります。" -"これは[`.into_iter()`](https://doc.rust-lang.org/std/iter/trait.IntoIterator.html)メソッドを呼び出しています。" +"サッとイテレータを使いたい時は、`for`文で集合からイテレータを作成することが良" +"くあります。これは[`.into_iter()`](https://doc.rust-lang.org/std/iter/trait." +"IntoIterator.html)メソッドを呼び出しています。" #: src/trait/iter.md:18 msgid "" @@ -10649,7 +11029,8 @@ msgstr "\"> {}\"" #: src/trait/iter.md:65 msgid "// The `take(n)` method reduces an `Iterator` to its first `n` terms.\n" -msgstr "// `take(n)`メソッドは`Iterator`を先頭から`n`番目の要素までに減らします。\n" +msgstr "" +"// `take(n)`メソッドは`Iterator`を先頭から`n`番目の要素までに減らします。\n" #: src/trait/iter.md:66 msgid "\"The first four terms of the Fibonacci sequence are: \"" @@ -10659,7 +11040,8 @@ msgstr "\"The first four terms of the Fibonacci sequence are: \"" msgid "" "// The `skip(n)` method shortens an `Iterator` by dropping its first `n` " "terms.\n" -msgstr "// `skip(n)`メソッドは`Iterator`の先頭から`n`番目までの要素をとばします。\n" +msgstr "" +"// `skip(n)`メソッドは`Iterator`の先頭から`n`番目までの要素をとばします。\n" #: src/trait/iter.md:72 msgid "\"The next four terms of the Fibonacci sequence are: \"" @@ -10695,9 +11077,8 @@ msgid "" "type, you can simplify the function declaration using `impl Trait` as the " "type of the argument." msgstr "" -"あなたの関数がジェネリックなトレイトを使用していて、" -"特定の型を意識していない場合、`impl Trait`を引数の型として利用して、" -"関数宣言をシンプルにできます。" +"あなたの関数がジェネリックなトレイトを使用していて、特定の型を意識していない" +"場合、`impl Trait`を引数の型として利用して、関数宣言をシンプルにできます。" #: src/trait/impl_trait.md:12 msgid "For example, consider the following code:" @@ -10739,10 +11120,10 @@ msgid "" "important what type `R` is, and `R` is only used to declare the type of " "`src`, so the function can also be written as:" msgstr "" -"`parse_csv_document`はジェネリックなので、BufReadを実装する任意の型を取ることができます。" -"例えば、`BufReader`や`[u8]`です。" -"`R`がどんな型かは重要ではなく、`src`の型宣言に使われているだけなので、" -"この関数は以下のように書くこともできます:" +"`parse_csv_document`はジェネリックなので、BufReadを実装する任意の型を取ること" +"ができます。例えば、`BufReader`や`[u8]`です。`R`がどんな型かは重要では" +"なく、`src`の型宣言に使われているだけなので、この関数は以下のように書くことも" +"できます:" #: src/trait/impl_trait.md:49 msgid "" @@ -10751,8 +11132,9 @@ msgid "" "`parse_csv_document::(std::io::empty())` will not work with " "the second example." msgstr "" -"`impl Trait`を引数の型として利用するということは、どのような形式の関数であるか明示できないので、注意してください。" -"例えば、`parse_csv_document::(std::io::empty())`は2番目の例では動作しません。" +"`impl Trait`を引数の型として利用するということは、どのような形式の関数である" +"か明示できないので、注意してください。例えば、`parse_csv_document::(std::io::empty())`は2番目の例では動作しません。" #: src/trait/impl_trait.md:52 msgid "As a return type" @@ -10764,9 +11146,8 @@ msgid "" "return type as `-> impl MyTrait`. This can help simplify your type " "signatures quite a lot!" msgstr "" -"あなたの関数が`MyTrait`を実装する型を返す場合、" -"リターン型を`-> impl MyTrait`のように書けます。" -"これで型シグネチャをとてもシンプルにできます。" +"あなたの関数が`MyTrait`を実装する型を返す場合、リターン型を`-> impl MyTrait`" +"のように書けます。これで型シグネチャをとてもシンプルにできます。" #: src/trait/impl_trait.md:60 msgid "" @@ -10795,10 +11176,10 @@ msgid "" "had to allocate on the heap in order to return a closure. But now you can do " "it all statically, like this:" msgstr "" -"より重要なことに、Rustの型には書き表せないものがあるのです。" -"例えば、あらゆるクロージャは独自の無名な具象型を持ちます。" -"`impl Trait`構文がない時は、クロージャを返すにはヒープ上に置かねばなりませんでした。" -"しかし今では次のようにすべて静的に行えます。" +"より重要なことに、Rustの型には書き表せないものがあるのです。例えば、あらゆる" +"クロージャは独自の無名な具象型を持ちます。`impl Trait`構文がない時は、クロー" +"ジャを返すにはヒープ上に置かねばなりませんでした。しかし今では次のようにすべ" +"て静的に行えます。" #: src/trait/impl_trait.md:98 msgid "// Returns a function that adds `y` to its input\n" @@ -10812,11 +11193,10 @@ msgid "" "if your function returns iterators with closures. But with `impl Trait` you " "can do this easily:" msgstr "" -"`impl Trait`を使って、`map`や`filter`クロージャを使うイテレータを返すこともできます。" -"おかげで`map`や`filter`を簡単に使えます。" -"クロージャ型は名前を持たないので、あなたの関数がクロージャを持つイテレータを返す場合、" -"明示的なリターン型を書くことはできません。" -"しかし`impl Trait`を使うことで簡単にできます:" +"`impl Trait`を使って、`map`や`filter`クロージャを使うイテレータを返すこともで" +"きます。おかげで`map`や`filter`を簡単に使えます。クロージャ型は名前を持たない" +"ので、あなたの関数がクロージャを持つイテレータを返す場合、明示的なリターン型" +"を書くことはできません。しかし`impl Trait`を使うことで簡単にできます:" #: src/trait/clone.md:3 msgid "" @@ -10824,8 +11204,9 @@ msgid "" "assignments or function calls. However, sometimes we need to make a copy of " "the resource as well." msgstr "" -"メモリ上の資源を扱う際、変数束縛や関数呼び出しを介して移動させるのがデフォルトの挙動です。" -"しかしながら、場合によっては資源のコピーを作るのが適切なこともあります。" +"メモリ上の資源を扱う際、変数束縛や関数呼び出しを介して移動させるのがデフォル" +"トの挙動です。しかしながら、場合によっては資源のコピーを作るのが適切なことも" +"あります。" #: src/trait/clone.md:7 msgid "" @@ -10833,8 +11214,9 @@ msgid "" "helps us do exactly this. Most commonly, we can use the `.clone()` method " "defined by the `Clone` trait." msgstr "" -"[`Clone`](https://doc.rust-lang.org/std/clone/trait.Clone.html)トレイト" -"はまさにこのためにあります。普通は`Clone`トレイトで定義されている`.clone()`を用います。" +"[`Clone`](https://doc.rust-lang.org/std/clone/trait.Clone.html)トレイトはまさ" +"にこのためにあります。普通は`Clone`トレイトで定義されている`.clone()`を用いま" +"す。" #: src/trait/clone.md:11 msgid "// A unit struct without resources\n" @@ -10888,7 +11270,9 @@ msgstr "" #: src/trait/clone.md:41 msgid "// Clone `moved_pair` into `cloned_pair` (resources are included)\n" -msgstr "// `moved_pair`を`cloned_pair`にクローンします。(資源もクローンされます。)\n" +msgstr "" +"// `moved_pair`を`cloned_pair`にクローンします。(資源もクローンされま" +"す。)\n" #: src/trait/clone.md:43 msgid "// Drop the moved original pair using std::mem::drop\n" @@ -10917,8 +11301,8 @@ msgid "" "Rust doesn't have \"inheritance\", but you can define a trait as being a " "superset of another trait. For example:" msgstr "" -"Rustには\"継承\"はありませんが、あるトレイトを別のトレイトの上位集合として定義できます。" -"例えば:" +"Rustには\"継承\"はありませんが、あるトレイトを別のトレイトの上位集合として定" +"義できます。例えば:" #: src/trait/supertraits.md:10 msgid "" @@ -10935,8 +11319,10 @@ msgid "" "// and Student. Implementing CompSciStudent requires you to impl both " "supertraits.\n" msgstr "" -"// CompSciStudent(コンピュータサイエンスの学生)はProgrammerとStudent両方のサブトレイトです。\n" -"// CompSciStudentを実装するには、両方のスーパートレイトを実装する必要があります。\n" +"// CompSciStudent(コンピュータサイエンスの学生)はProgrammerとStudent両方の" +"サブトレイトです。\n" +"// CompSciStudentを実装するには、両方のスーパートレイトを実装する必要がありま" +"す。\n" #: src/trait/supertraits.md:29 msgid "" @@ -11014,12 +11400,12 @@ msgid "" "expanded into abstract syntax trees, rather than string preprocessing, so " "you don't get unexpected precedence bugs." msgstr "" -"Rustはメタプログラミングを可能にする、パワフルなマクロシステムを備えています。" -"これまで見てきたように、マクロは`!`で終わることを除けば関数のように見えます。" -"関数と違うのは関数呼び出しを生成する代わりに、" -"ソースコード中に展開され、周囲のプログラムとともにコンパイルされる点です。" -"しかし、Cやその他の言語のマクロが文字列のプリプロセッシングをするのと異なり、" -"Rustのマクロは抽象構文木へと展開されるので、予期せぬ演算子の優先順位のバグに出くわすことがありません。" +"Rustはメタプログラミングを可能にする、パワフルなマクロシステムを備えていま" +"す。これまで見てきたように、マクロは`!`で終わることを除けば関数のように見えま" +"す。関数と違うのは関数呼び出しを生成する代わりに、ソースコード中に展開され、" +"周囲のプログラムとともにコンパイルされる点です。しかし、Cやその他の言語のマク" +"ロが文字列のプリプロセッシングをするのと異なり、Rustのマクロは抽象構文木へと" +"展開されるので、予期せぬ演算子の優先順位のバグに出くわすことがありません。" #: src/macros.md:11 msgid "Macros are created using the `macro_rules!` macro." @@ -11044,8 +11430,8 @@ msgid "\"Hello!\"" msgstr "\"Hello!\"" #: src/macros.md:24 -msgid "// This call will expand into `println!(\"Hello\")`\n" -msgstr "// この呼び出しは`println!(\"Hello\");`に置き換えられます。\n" +msgid "// This call will expand into `println!(\"Hello!\")`\n" +msgstr "// この呼び出しは`println!(\"Hello!\");`に置き換えられます。\n" #: src/macros.md:29 msgid "So why are macros useful?" @@ -11057,15 +11443,17 @@ msgid "" "functionality in multiple places but with different types. Often, writing a " "macro is a useful way to avoid repeating code. (More on this later)" msgstr "" -"同じことを繰り返し書いてはいけないから。" -"複数の場所で、別の型だけれど似たような機能が必要な時がよくあります。" -"しばしば、マクロはコードを繰り返し書くのを避ける有用な手段なのです(あとで詳述)。" +"同じことを繰り返し書いてはいけないから。複数の場所で、別の型だけれど似たよう" +"な機能が必要な時がよくあります。しばしば、マクロはコードを繰り返し書くのを避" +"ける有用な手段なのです(あとで詳述)。" #: src/macros.md:35 msgid "" "Domain-specific languages. Macros allow you to define special syntax for a " "specific purpose. (More on this later)" -msgstr "ドメイン特化言語であるから。マクロを使うと、特定の目的のための特定の構文を定義することができます(あとで詳述)。" +msgstr "" +"ドメイン特化言語であるから。マクロを使うと、特定の目的のための特定の構文を定" +"義することができます(あとで詳述)。" #: src/macros.md:38 msgid "" @@ -11073,17 +11461,17 @@ msgid "" "variable number of arguments. An example is `println!` which could take any " "number of arguments, depending on the format string. (More on this later)" msgstr "" -"可変個引数によるインターフェース。" -"取る引数の数が可変であるようなインターフェースを定義したくなることもあるでしょう。" -"例えば、`println!`は、フォーマット文字列に依存した任意の数の引数を取ることができます(あとで詳述)!" +"可変個引数によるインターフェース。取る引数の数が可変であるようなインター" +"フェースを定義したくなることもあるでしょう。例えば、`println!`は、フォーマッ" +"ト文字列に依存した任意の数の引数を取ることができます(あとで詳述)!" #: src/macros/syntax.md:3 msgid "" "In following subsections, we will show how to define macros in Rust. There " "are three basic ideas:" msgstr "" -"以下のサブセクションでは、Rustにおいてマクロを定義する方法を示します。" -"3つの基本的な考え方があります:" +"以下のサブセクションでは、Rustにおいてマクロを定義する方法を示します。3つの基" +"本的な考え方があります:" #: src/macros/syntax.md:6 msgid "[Patterns and Designators](designators.md)" @@ -11101,7 +11489,8 @@ msgstr "[繰り返し](repeat.md)" msgid "" "The arguments of a macro are prefixed by a dollar sign `$` and type " "annotated with a _designator_:" -msgstr "macroの引数は`$`が頭につきます。型は *識別子* でアノテーションされます。" +msgstr "" +"macroの引数は`$`が頭につきます。型は *識別子* でアノテーションされます。" #: src/macros/designators.md:8 msgid "" @@ -11200,16 +11589,16 @@ msgid "" "For a complete list, see the [Rust Reference](https://doc.rust-lang.org/" "reference/macros-by-example.html)." msgstr "" -"完全なリストを見るには、" -"[Rustリファレンス](https://doc.rust-lang.org/reference/macros-by-example.html)を読んでください。" +"完全なリストを見るには、[Rustリファレンス](https://doc.rust-lang.org/" +"reference/macros-by-example.html)を読んでください。" #: src/macros/overload.md:3 msgid "" "Macros can be overloaded to accept different combinations of arguments. In " "that regard, `macro_rules!` can work similarly to a match block:" msgstr "" -"マクロは異なる引数の組み合わせを取るようにオーバーロードすることができるため、" -"`macro_rules!`はマッチと似たような使い方をすることができます。" +"マクロは異なる引数の組み合わせを取るようにオーバーロードすることができるた" +"め、`macro_rules!`はマッチと似たような使い方をすることができます。" #: src/macros/overload.md:7 msgid "" @@ -11245,9 +11634,9 @@ msgid "" "repeat at least once, or `*`, to indicate that the argument may repeat zero " "or more times." msgstr "" -"マクロは引数のリストの中で`+`を使うことができ、そうすることによって、" -"引数が少なくとも1回以上繰り返されるということを示すことができます。" -"同様に`*`の場合は、0以上を示します。" +"マクロは引数のリストの中で`+`を使うことができ、そうすることによって、引数が少" +"なくとも1回以上繰り返されるということを示すことができます。同様に`*`の場合" +"は、0以上を示します。" #: src/macros/repeat.md:7 msgid "" @@ -11255,9 +11644,8 @@ msgid "" "one or more expression, separated by commas. Also note that the semicolon is " "optional on the last case." msgstr "" -"以下の例では、マッチ対象を `$(...),+`で囲むことにより、" -"カンマで区切られた1つ以上の式とマッチします。" -"最後のセミコロンは必須ではないことに注目しましょう。" +"以下の例では、マッチ対象を `$(...),+`で囲むことにより、カンマで区切られた1つ" +"以上の式とマッチします。最後のセミコロンは必須ではないことに注目しましょう。" #: src/macros/repeat.md:12 msgid "// `find_min!` will calculate the minimum of any number of arguments.\n" @@ -11281,8 +11669,9 @@ msgid "" "and/or test suites. Here is an example that implements and tests the `+=`, " "`*=` and `-=` operators on `Vec`:" msgstr "" -"マクロは関数やテストなどにおいて、共通の部分を抽出することでDRYなコードを書くのに役立ちます。" -"ここでは`Vec`に`+=`、`*=`、`-=`を実装、テストするにあたって、マクロがどのように役立つかを見ていきます。" +"マクロは関数やテストなどにおいて、共通の部分を抽出することでDRYなコードを書く" +"のに役立ちます。ここでは`Vec`に`+=`、`*=`、`-=`を実装、テストするにあたっ" +"て、マクロがどのように役立つかを見ていきます。" #: src/macros/dry.md:11 msgid "" @@ -11317,17 +11706,19 @@ msgid "" "it looks like a small language. This allows you to define concise or " "intuitive syntax for some special functionality (within bounds)." msgstr "" -"ここで言うDSLとはRustマクロに埋め込まれた小さな「言語」のことです。" -"マクロ機能は通常のRustのプログラムへと展開されるので、これは完全に正当なRustなのですが、まるで小さな言語であるかのように見えます。" -"これにより、(一定の条件のもとで)なんらかの特定の機能のための簡潔・直感的な構文を定義することができるようになります。" +"ここで言うDSLとはRustマクロに埋め込まれた小さな「言語」のことです。マクロ機能" +"は通常のRustのプログラムへと展開されるので、これは完全に正当なRustなのです" +"が、まるで小さな言語であるかのように見えます。これにより、(一定の条件のもと" +"で)なんらかの特定の機能のための簡潔・直感的な構文を定義することができるよう" +"になります。" #: src/macros/dsl.md:8 msgid "" "Suppose that I want to define a little calculator API. I would like to " "supply an expression and have the output printed to console." msgstr "" -"ちょっとした計算機APIを定義したいとしましょう。" -"式を与えると、出力がコンソールに書き出されるようにしたいです。" +"ちょっとした計算機APIを定義したいとしましょう。式を与えると、出力がコンソール" +"に書き出されるようにしたいです。" #: src/macros/dsl.md:15 msgid "// Force types to be unsigned integers\n" @@ -11351,16 +11742,17 @@ msgid "" "developed, such as [`lazy_static`](https://crates.io/crates/lazy_static) or " "[`clap`](https://crates.io/crates/clap)." msgstr "" -"これはとても単純な例ですが、[`lazy_static`](https://crates.io/crates/lazy_static)や" -"[`clap`](https://crates.io/crates/clap)のように、もっと複雑なインターフェースも開発されています。" +"これはとても単純な例ですが、[`lazy_static`](https://crates.io/crates/" +"lazy_static)や[`clap`](https://crates.io/crates/clap)のように、もっと複雑なイ" +"ンターフェースも開発されています。" #: src/macros/dsl.md:43 msgid "" "Also, note the two pairs of braces in the macro. The outer ones are part of " "the syntax of `macro_rules!`, in addition to `()` or `[]`." msgstr "" -"また、マクロの中に2組の括弧があることにも注目してください。" -"外側のは、`()`や`[]`に加え、`macro_rules!`の構文の一部です。" +"また、マクロの中に2組の括弧があることにも注目してください。外側のは、`()`や" +"`[]`に加え、`macro_rules!`の構文の一部です。" #: src/macros/variadics.md:1 msgid "Variadic Interfaces" @@ -11372,14 +11764,16 @@ msgid "" "`println!` can take an arbitrary number of arguments, as determined by the " "format string." msgstr "" -"*可変個引数の*インターフェースとは、任意の数の引数を取るものです。" -"例えば、`println!`は、フォーマット文字列の定義に従い、任意の数の引数を取ることができます。" +"*可変個引数の*インターフェースとは、任意の数の引数を取るものです。例えば、" +"`println!`は、フォーマット文字列の定義に従い、任意の数の引数を取ることができ" +"ます。" #: src/macros/variadics.md:7 msgid "" "We can extend our `calculate!` macro from the previous section to be " "variadic:" -msgstr "前のセクションの`calculate!`マクロを、可変個引数に拡張することができます:" +msgstr "" +"前のセクションの`calculate!`マクロを、可変個引数に拡張することができます:" #: src/macros/variadics.md:11 msgid "// The pattern for a single `eval`\n" @@ -11404,9 +11798,10 @@ msgid "" "would clearly be problematic. Noticing and explicitly managing those errors " "saves the rest of the program from various pitfalls." msgstr "" -"エラーハンドリングとは失敗の起きる可能性を扱うプロセスのことです。" -"例えば、ファイルを読み込むのに失敗した際、その *誤った* インプットを使い続けるのは明らかに問題です。" -"そのようなエラーを通知して明示的に扱うことで、残りのプログラムに問題が波及することを防ぐことができるようになります。" +"エラーハンドリングとは失敗の起きる可能性を扱うプロセスのことです。例えば、" +"ファイルを読み込むのに失敗した際、その *誤った* インプットを使い続けるのは明" +"らかに問題です。そのようなエラーを通知して明示的に扱うことで、残りのプログラ" +"ムに問題が波及することを防ぐことができるようになります。" #: src/error.md:8 msgid "" @@ -11414,8 +11809,8 @@ msgid "" "the following subchapters. They all have more or less subtle differences and " "different use cases. As a rule of thumb:" msgstr "" -"Rustには、これからこの章で見ていく通り、エラーを処理するための様々な方法が存在します。" -"それらは全て僅かに異なり、ユースケースも異なります。経験則として:" +"Rustには、これからこの章で見ていく通り、エラーを処理するための様々な方法が存" +"在します。それらは全て僅かに異なり、ユースケースも異なります。経験則として:" #: src/error.md:12 msgid "" @@ -11425,10 +11820,10 @@ msgid "" "the more descriptive `unimplemented` is better. In tests `panic` is a " "reasonable way to explicitly fail." msgstr "" -"明示的な`panic`はテストや復旧不可能なエラーに対して効果的です。" -"プロトタイプにも便利で、例えば未実装の関数を扱う時などに有効ですが、" -"このような場合にはより叙述的な`unimplemented`の方が良いでしょう。" -"テストにおいては`panic`は明示的にテストを失敗させるための良い手法になるでしょう。" +"明示的な`panic`はテストや復旧不可能なエラーに対して効果的です。プロトタイプに" +"も便利で、例えば未実装の関数を扱う時などに有効ですが、このような場合にはより" +"叙述的な`unimplemented`の方が良いでしょう。テストにおいては`panic`は明示的に" +"テストを失敗させるための良い手法になるでしょう。" #: src/error.md:17 msgid "" @@ -11439,10 +11834,11 @@ msgid "" "to be a value. However `expect` is more useful since it lets you specify an " "error message in case something goes wrong anyway." msgstr "" -"`Option`型は値があるとは限らない場合や、値が無いことがエラーの条件とならない場合に有効です。" -"例えば親ディレクトリ(`/`や`C:`はそれを持ちません)などです。" -"`Option`を扱う際は、`unwrap`がプロトタイプや値が確実に存在することが約束されるケースに使えます。" -"しかし、`expect`の方が何かが上手くいかなかった際にエラーメッセージを指定することができるため、より便利でしょう。" +"`Option`型は値があるとは限らない場合や、値が無いことがエラーの条件とならない" +"場合に有効です。例えば親ディレクトリ(`/`や`C:`はそれを持ちません)などです。" +"`Option`を扱う際は、`unwrap`がプロトタイプや値が確実に存在することが約束され" +"るケースに使えます。しかし、`expect`の方が何かが上手くいかなかった際にエラー" +"メッセージを指定することができるため、より便利でしょう。" #: src/error.md:24 msgid "" @@ -11450,8 +11846,9 @@ msgid "" "with the problem, use `Result`. You can `unwrap` and `expect` them as well " "(please don't do that unless it's a test or quick prototype)." msgstr "" -"何かが上手くいかない可能性があったり、呼び出し元が問題を処理しなければならない時は、`Result`を使いましょう。" -"`unwrap`や`expect`を実行することもできます(テストや短期的なプロトタイプ以外では使わないでください)。" +"何かが上手くいかない可能性があったり、呼び出し元が問題を処理しなければならな" +"い時は、`Result`を使いましょう。`unwrap`や`expect`を実行することもできます" +"(テストや短期的なプロトタイプ以外では使わないでください)。" #: src/error.md:28 msgid "" @@ -11459,9 +11856,9 @@ msgid "" "handling section in the [official book](https://doc.rust-lang.org/book/" "ch09-00-error-handling.html)." msgstr "" -"より詳細なエラーハンドリングに関する議論については、" -"[オフィシャルブック](https://doc.rust-lang.org/book/ch09-00-error-handling.html)" -"の該当の章を参考にしてください。" +"より詳細なエラーハンドリングに関する議論については、[オフィシャルブック]" +"(https://doc.rust-lang.org/book/ch09-00-error-handling.html)の該当の章を参考" +"にしてください。" #: src/error/panic.md:3 msgid "" @@ -11469,9 +11866,9 @@ msgid "" "error message, starts unwinding the stack, and usually exits the program. " "Here, we explicitly call `panic` on our error condition:" msgstr "" -"`panic`は、最もシンプルなエラーハンドリングの仕組みです。" -"エラーメッセージの出力、スタックの巻き戻し、そして多くの場合プログラムの終了を実行します。" -"例として、エラー条件に対して明示的に`panic`を呼び出してみましょう。" +"`panic`は、最もシンプルなエラーハンドリングの仕組みです。エラーメッセージの出" +"力、スタックの巻き戻し、そして多くの場合プログラムの終了を実行します。例とし" +"て、エラー条件に対して明示的に`panic`を呼び出してみましょう。" #: src/error/panic.md:9 src/error/abort_unwind.md:10 msgid "// You shouldn't drink too much sugary beverages.\n" @@ -11560,10 +11957,10 @@ msgid "" "expect _some_ drink but don't receive one? That case would be just as bad, " "so it needs to be handled!" msgstr "" -"以前の例では、甘いレモネードを飲んだ際に`panic`を呼び出すことによって、" -"自由にプログラムの実行を失敗させられることが分かりました。" -"では、何らかの飲み物を期待しているにもかかわらず、何も受け取らなかったらどうなるでしょう?" -"これは悲惨なケースになるので、エラーハンドリングする必要があります!" +"以前の例では、甘いレモネードを飲んだ際に`panic`を呼び出すことによって、自由に" +"プログラムの実行を失敗させられることが分かりました。では、何らかの飲み物を期" +"待しているにもかかわらず、何も受け取らなかったらどうなるでしょう?これは悲惨" +"なケースになるので、エラーハンドリングする必要があります!" #: src/error/option_unwrap.md:8 msgid "" @@ -11571,17 +11968,18 @@ msgid "" "lemonade. Since we're using Rust, let's instead have the compiler point out " "cases where there's no drink." msgstr "" -"このケースに対して、レモネードと同じように、空文字列(`\"\"`)と比較することもできますが、" -"せっかくRustを使っているので、その代わりにコンパイラに飲み物がないケースを指摘させてみましょう。" +"このケースに対して、レモネードと同じように、空文字列(`\"\"`)と比較すること" +"もできますが、せっかくRustを使っているので、その代わりにコンパイラに飲み物が" +"ないケースを指摘させてみましょう。" #: src/error/option_unwrap.md:12 msgid "" "An `enum` called `Option` in the `std` library is used when absence is a " "possibility. It manifests itself as one of two \"options\":" msgstr "" -"`std`ライブラリの中の、`Option`と呼ばれる`enum`は、" -"任意の型`T`である変数の値が存在しない可能性がある場合に用いられます。" -"値の状態によって、下記2つのパターンのうちの1つとして扱われます。" +"`std`ライブラリの中の、`Option`と呼ばれる`enum`は、任意の型`T`である変数の" +"値が存在しない可能性がある場合に用いられます。値の状態によって、下記2つのパ" +"ターンのうちの1つとして扱われます。" #: src/error/option_unwrap.md:15 msgid "`Some(T)`: An element of type `T` was found" @@ -11596,9 +11994,8 @@ msgid "" "These cases can either be explicitly handled via `match` or implicitly with " "`unwrap`. Implicit handling will either return the inner element or `panic`." msgstr "" -"これらは`match`を用いて明示的に扱うこともできますし、" -"`unwrap`で暗黙に処理することもできます。" -"後者は`Some`の中の値を返すか`panic`するかのどちらかです。" +"これらは`match`を用いて明示的に扱うこともできますし、`unwrap`で暗黙に処理する" +"こともできます。後者は`Some`の中の値を返すか`panic`するかのどちらかです。" #: src/error/option_unwrap.md:21 msgid "" @@ -11608,10 +12005,11 @@ msgid "" "the following example, explicit handling yields a more controlled result " "while retaining the option to `panic` if desired." msgstr "" -"[expect](https://doc.rust-lang.org/std/option/enum.Option.html#method.expect)メソッドを用いて、" -"`panic`を手動でカスタマイズできることに触れておきましょう。" -"これは(`unwrap`をそのまま用いた場合よりも)内容が理解しやすいエラーメッセージを出力するのに役立ちます。" -"次の例では、結果をより明示的に、可能ならいつでも`panic`できるように扱っていきます。" +"[expect](https://doc.rust-lang.org/std/option/enum.Option.html#method.expect)" +"メソッドを用いて、`panic`を手動でカスタマイズできることに触れておきましょう。" +"これは(`unwrap`をそのまま用いた場合よりも)内容が理解しやすいエラーメッセー" +"ジを出力するのに役立ちます。次の例では、結果をより明示的に、可能ならいつでも" +"`panic`できるように扱っていきます。" #: src/error/option_unwrap.md:27 msgid "" @@ -11664,9 +12062,10 @@ msgid "" "return the underlying value if `x` is `Some`, otherwise it will terminate " "whatever function is being executed and return `None`." msgstr "" -"`Option`をアンパックするには`match`文を使うこともできますが、`?`を使う方が簡単になることが多いでしょう。" -"`Option`の`x`があるとすると、`x?`を評価した値は、`x`が`Some`の場合は`x`に格納された値となり、" -"そうでなければ実行中の関数を終了させ、`None`を返します。" +"`Option`をアンパックするには`match`文を使うこともできますが、`?`を使う方が簡" +"単になることが多いでしょう。`Option`の`x`があるとすると、`x?`を評価した値は、" +"`x`が`Some`の場合は`x`に格納された値となり、そうでなければ実行中の関数を終了" +"させ、`None`を返します。" #: src/error/option_unwrap/question_mark.md:10 msgid "" @@ -11675,7 +12074,8 @@ msgid "" " // gets assigned to `next_age`\n" msgstr "" "// `current_age`が`None`の場合、`None`を返します。\n" -" // `current_age`が`Some`の場合、内部の`u8`型の値が`next_age`に代入されます。\n" +" // `current_age`が`Some`の場合、内部の`u8`型の値が`next_age`に代入されま" +"す。\n" #: src/error/option_unwrap/question_mark.md:14 msgid "\"Next year I will be {}\"" @@ -11710,11 +12110,11 @@ msgid "" "reference/glossary.html#combinator) can be used to manage control flow in a " "modular fashion." msgstr "" -"`match`は`Option`を扱うのに適したメソッドです。" -"しかし、大量にこれを使用しているとじきに億劫になってくるでしょう。" -"引数の値が有効である(訳注: この場合は`None`でない)必要がある関数を扱う際には特にそうです。" -"そうした場合には、[コンビネータ](https://doc.rust-lang.org/reference/glossary.html#combinator)" -"を使うと、処理の流れをモジュール化されたやり方で管理できます。" +"`match`は`Option`を扱うのに適したメソッドです。しかし、大量にこれを使用してい" +"るとじきに億劫になってくるでしょう。引数の値が有効である(訳注: この場合は" +"`None`でない)必要がある関数を扱う際には特にそうです。そうした場合には、[コン" +"ビネータ](https://doc.rust-lang.org/reference/glossary.html#combinator)を使う" +"と、処理の流れをモジュール化されたやり方で管理できます。" #: src/error/option_unwrap/map.md:8 msgid "" @@ -11722,17 +12122,18 @@ msgid "" "mapping of `Some -> Some` and `None -> None`. Multiple `map()` calls can be " "chained together for even more flexibility." msgstr "" -"`Some -> Some`あるいは`None -> None`の単純な操作を適用する必要がある場合には、" -"`Option`は`map()`というビルトインのメソッドを提供していますので、これを使用しましょう。" -"`map()`のフレキシビリティは、複数の`map()`をチェインしなければならない場合にさらに際立ちます。" +"`Some -> Some`あるいは`None -> None`の単純な操作を適用する必要がある場合に" +"は、`Option`は`map()`というビルトインのメソッドを提供していますので、これを使" +"用しましょう。`map()`のフレキシビリティは、複数の`map()`をチェインしなければ" +"ならない場合にさらに際立ちます。" #: src/error/option_unwrap/map.md:12 msgid "" "In the following example, `process()` replaces all functions previous to it " "while staying compact." msgstr "" -"以下の例では、`process()`が直前の関数全てを用いた場合と同じ機能を、" -"よりコンパクトに果たしているのがわかります。" +"以下の例では、`process()`が直前の関数全てを用いた場合と同じ機能を、よりコンパ" +"クトに果たしているのがわかります。" #: src/error/option_unwrap/map.md:23 msgid "" @@ -11746,19 +12147,24 @@ msgstr "" msgid "" "// Chopping food. If there isn't any, then return `None`.\n" "// Otherwise, return the chopped food.\n" -msgstr "// 上と同じように、食べ物を切る前に、皮を向いた食べ物の有無を知る必要があります。\n" +msgstr "" +"// 上と同じように、食べ物を切る前に、皮を向いた食べ物の有無を知る必要がありま" +"す。\n" #: src/error/option_unwrap/map.md:41 msgid "" "// Cooking food. Here, we showcase `map()` instead of `match` for case " "handling.\n" -msgstr "// 上のチェックと同様ですが`match`の代わりに`map()`を使用しています。\n" +msgstr "" +"// 上のチェックと同様ですが`match`の代わりに`map()`を使用しています。\n" #: src/error/option_unwrap/map.md:46 msgid "" "// A function to peel, chop, and cook food all in sequence.\n" "// We chain multiple uses of `map()` to simplify the code.\n" -msgstr "// 複数の`map()`をチェインさせて、上のプロセスをシンプルにすることもできます。\n" +msgstr "" +"// 複数の`map()`をチェインさせて、上のプロセスをシンプルにすることもできま" +"す。\n" #: src/error/option_unwrap/map.md:54 msgid "// Check whether there's food or not before trying to eat it!\n" @@ -11794,18 +12200,19 @@ msgid "" "become confusing. That's where another combinator called `and_then()`, " "known in some languages as flatmap, comes in." msgstr "" -"先ほどは`map()`を、チェイン構文を用いて`match`文を単純化する物として説明しました。" -"しかし`Option`を返す関数に対しての`map()`の使用はネストした`Option>`を生じさせます。" -"ですので、複数の関数呼び出しをチェインさせることは混乱を招く場合があります。" -"そんな時こそ`and_then()`の出番です。他の言語ではflatmapと呼ばれることもあります。" +"先ほどは`map()`を、チェイン構文を用いて`match`文を単純化する物として説明しま" +"した。しかし`Option`を返す関数に対しての`map()`の使用はネストした" +"`Option>`を生じさせます。ですので、複数の関数呼び出しをチェインさせ" +"ることは混乱を招く場合があります。そんな時こそ`and_then()`の出番です。他の言" +"語ではflatmapと呼ばれることもあります。" #: src/error/option_unwrap/and_then.md:9 msgid "" "`and_then()` calls its function input with the wrapped value and returns the " "result. If the `Option` is `None`, then it returns `None` instead." msgstr "" -"`and_then()`は引数として与えられた関数にラップされた値を渡しますが、" -"その値が`None`だった場合は`None`を返します。" +"`and_then()`は引数として与えられた関数にラップされた値を渡しますが、その値が" +"`None`だった場合は`None`を返します。" #: src/error/option_unwrap/and_then.md:11 msgid "" @@ -11813,9 +12220,9 @@ msgid "" "Using `map()` instead of `and_then()` would have given an " "`Option>`, which is an invalid type for `eat()`." msgstr "" -"以下の例では`cookable_v3()`は`Option`を返すため、" -"`and_then()`ではなく`map()`を使用すると最終的に`Option>`になります。" -"これは`eat()`には不適切な型です。" +"以下の例では`cookable_v3()`は`Option`を返すため、`and_then()`ではなく" +"`map()`を使用すると最終的に`Option>`になります。これは`eat()`に" +"は不適切な型です。" #: src/error/option_unwrap/and_then.md:20 msgid "// We don't have the ingredients to make Sushi.\n" @@ -11836,7 +12243,8 @@ msgstr "" #: src/error/option_unwrap/and_then.md:45 msgid "" "// This can conveniently be rewritten more compactly with `and_then()`:\n" -msgstr "// `and_then()`を用いることで、同じことをよりコンパクトに表現できます。\n" +msgstr "" +"// `and_then()`を用いることで、同じことをよりコンパクトに表現できます。\n" #: src/error/option_unwrap/and_then.md:50 msgid "" @@ -11861,8 +12269,8 @@ msgid "" msgstr "" "[クロージャ](../../fn/closures.md), [`Option`](https://doc.rust-lang.org/std/" "option/enum.Option.html), [`Option::and_then()`](https://doc.rust-lang.org/" -"std/option/enum.Option.html#method.and_then), [`Option::flatten()`]" -"(https://doc.rust-lang.org/std/option/enum.Option.html#method.flatten)" +"std/option/enum.Option.html#method.and_then), [`Option::flatten()`](https://" +"doc.rust-lang.org/std/option/enum.Option.html#method.flatten)" #: src/error/option_unwrap/defaults.md:1 msgid "Unpacking options and defaults" @@ -12029,9 +12437,9 @@ msgid "" "Option.html) type that describes possible _error_ instead of possible " "_absence_." msgstr "" -"[`Result`](https://doc.rust-lang.org/std/result/enum.Result.html)は、" -"リッチなバージョンの[`Option`](https://doc.rust-lang.org/std/option/enum.Option.html)型で" -"*値の不在*の可能性の代わりに*エラー*の可能性を示します。" +"[`Result`](https://doc.rust-lang.org/std/result/enum.Result.html)は、リッチな" +"バージョンの[`Option`](https://doc.rust-lang.org/std/option/enum.Option.html)" +"型で*値の不在*の可能性の代わりに*エラー*の可能性を示します。" #: src/error/result.md:6 msgid "That is, `Result` could have one of two outcomes:" @@ -12057,9 +12465,9 @@ msgid "" "example, either yields the element `T` or `panic`s. For case handling, there " "are many combinators between `Result` and `Option` that overlap." msgstr "" -"`Option`と同様、`Result`は多くのメソッドを持ちます。" -"例えば`unwrap()`は、`T`もしくは`panic`をもたらします。" -"エラーハンドリングでは、`Result`と`Option`で重複するコンビネータが多くあります。" +"`Option`と同様、`Result`は多くのメソッドを持ちます。例えば`unwrap()`は、`T`も" +"しくは`panic`をもたらします。エラーハンドリングでは、`Result`と`Option`で重複" +"するコンビネータが多くあります。" #: src/error/result.md:17 msgid "" @@ -12069,10 +12477,10 @@ msgid "" "parse a string into the other type, so `parse()` returns a `Result` " "indicating possible failure." msgstr "" -"Rustを書いていく中で、[`parse()`](https://doc.rust-lang.org/std/primitive.str.html#method.parse)メソッドなど、" -"`Result`型を返すメソッドを目にするでしょう。" -"文字列を他の型にパースすることは必ずしも成功する訳ではないため、" -"`Result`を返すことで失敗するケースについてもカバーできるのです。" +"Rustを書いていく中で、[`parse()`](https://doc.rust-lang.org/std/primitive." +"str.html#method.parse)メソッドなど、`Result`型を返すメソッドを目にするでしょ" +"う。文字列を他の型にパースすることは必ずしも成功する訳ではないため、`Result`" +"を返すことで失敗するケースについてもカバーできるのです。" #: src/error/result.md:22 msgid "" @@ -12114,8 +12522,8 @@ msgid "" "to `panic` on. Additionally, the `panic` exits our program and provides an " "unpleasant error message." msgstr "" -"失敗例では、`parse()`がエラーを返すため`unwrap()`がパニックします。" -"そして、`panic`はプログラムを終了させて不快なエラーメッセージを出力します。" +"失敗例では、`parse()`がエラーを返すため`unwrap()`がパニックします。そして、" +"`panic`はプログラムを終了させて不快なエラーメッセージを出力します。" #: src/error/result.md:45 msgid "" @@ -12134,8 +12542,8 @@ msgid "" "The `Result` type can also be the return type of the `main` function if " "specified explicitly. Typically the `main` function will be of the form:" msgstr "" -"`Result`型は、明示的な指定により`main`関数のリターン型にもなります。" -"一般に、`main`関数は以下のような形になるでしょう。" +"`Result`型は、明示的な指定により`main`関数のリターン型にもなります。一般に、" +"`main`関数は以下のような形になるでしょう。" #: src/error/result.md:59 msgid "" @@ -12146,11 +12554,11 @@ msgid "" "scenario and touches on aspects covered in [the following section](result/" "early_returns.md)." msgstr "" -"一方`main`で`Result`をリターン型とすることも可能です。" -"エラーが`main`関数内で発生した時、エラーコードを返し、エラーに関するデバッグ表記を" -"([`Debug`](https://doc.rust-lang.org/std/fmt/trait.Debug.html)トレイトを使って)" -"出力します。以下の例ではそのようなシナリオを示し、[この先の節](result/early_returns.md)" -"でカバーする内容に触れていきます。" +"一方`main`で`Result`をリターン型とすることも可能です。エラーが`main`関数内で" +"発生した時、エラーコードを返し、エラーに関するデバッグ表記を([`Debug`]" +"(https://doc.rust-lang.org/std/fmt/trait.Debug.html)トレイトを使って)出力し" +"ます。以下の例ではそのようなシナリオを示し、[この先の節](result/" +"early_returns.md)でカバーする内容に触れていきます。" #: src/error/result/result_map.md:3 msgid "" @@ -12159,8 +12567,8 @@ msgid "" "what is the right way to respond to errors." msgstr "" "前の例で見た`multiply`でのパニックは、コードを強固にするためには書きません。" -"一般に、呼び出した側がエラーをどのように対処するべきかを自由に決められるように、" -"エラーを呼び出した場所に返すのが好ましいです。" +"一般に、呼び出した側がエラーをどのように対処するべきかを自由に決められるよう" +"に、エラーを呼び出した場所に返すのが好ましいです。" #: src/error/result/result_map.md:7 msgid "" @@ -12172,24 +12580,28 @@ msgid "" "`Err` type is specified as [`ParseIntError`](https://doc.rust-lang.org/std/" "num/struct.ParseIntError.html)." msgstr "" -"まずは、どのようなエラー型を扱っているのかを知る必要があります。" -"`Err`型を定めるために、[`i32`](https://doc.rust-lang.org/std/primitive.i32.html)" -"に対し[`FromStr`](https://doc.rust-lang.org/std/str/trait.FromStr.html)トレイトを使って実装された" -"[`parse()`](https://doc.rust-lang.org/std/primitive.str.html#method.parse)を見てみましょう。" -"結果、`Err`型は[`ParseIntError`](https://doc.rust-lang.org/std/num/struct.ParseIntError.html)" -"というものであることが分かります。" +"まずは、どのようなエラー型を扱っているのかを知る必要があります。`Err`型を定め" +"るために、[`i32`](https://doc.rust-lang.org/std/primitive.i32.html)に対し" +"[`FromStr`](https://doc.rust-lang.org/std/str/trait.FromStr.html)トレイトを" +"使って実装された[`parse()`](https://doc.rust-lang.org/std/primitive.str." +"html#method.parse)を見てみましょう。結果、`Err`型は[`ParseIntError`](https://" +"doc.rust-lang.org/std/num/struct.ParseIntError.html)というものであることが分" +"かります。" #: src/error/result/result_map.md:12 msgid "" "In the example below, the straightforward `match` statement leads to code " "that is overall more cumbersome." -msgstr "以下の例では、単純な`match`文が全体として扱いづらいコードにしています。" +msgstr "" +"以下の例では、単純な`match`文が全体として扱いづらいコードにしています。" #: src/error/result/result_map.md:17 msgid "" "// With the return type rewritten, we use pattern matching without " "`unwrap()`.\n" -msgstr "// リターン型を再度記述することで、パターンマッチングを`unwrap()`なしで行います。\n" +msgstr "" +"// リターン型を再度記述することで、パターンマッチングを`unwrap()`なしで行いま" +"す。\n" #: src/error/result/result_map.md:35 src/error/result/result_map.md:68 #: src/error/result/result_alias.md:30 src/error/result/early_returns.md:30 @@ -12223,8 +12635,9 @@ msgid "" "implemented for `Result`. [`Result`](https://doc.rust-lang.org/std/result/" "enum.Result.html) contains a complete listing." msgstr "" -"幸運にも、`Option`の`map`、`and_then`、その他多くのコンビネータも`Result`のために実装されています。" -"[`Result`](https://doc.rust-lang.org/std/result/enum.Result.html)に全てのリストが記載されています。" +"幸運にも、`Option`の`map`、`and_then`、その他多くのコンビネータも`Result`のた" +"めに実装されています。[`Result`](https://doc.rust-lang.org/std/result/enum." +"Result.html)に全てのリストが記載されています。" #: src/error/result/result_map.md:56 msgid "" @@ -12235,7 +12648,8 @@ msgid "" msgstr "" "// `Option`と同様、`map()`などのコンビネータを使うことができます。\n" "// この関数は`map()`を使っている点以外は上記の関数と同じで、\n" -"// 両方の値がstrからパース可能であればそれらを乗算し、無効であればエラーをそのまま見送ります。\n" +"// 両方の値がstrからパース可能であればそれらを乗算し、無効であればエラーをそ" +"のまま見送ります。\n" #: src/error/result/result_alias.md:3 msgid "" @@ -12243,9 +12657,9 @@ msgid "" "that Rust allows us to create [aliases](../../types/alias.md). Conveniently, " "we can define one for the specific `Result` in question." msgstr "" -"特定の`Result`型を何度も使いたくなるのはどんな時でしょう?" -"Rustは[エイリアス](../../types/alias.md)の作成をサポートしていたことを思い出してください。" -"便利なことに、特定の`Result`型に対しても定義することができます。" +"特定の`Result`型を何度も使いたくなるのはどんな時でしょう?Rustは[エイリアス]" +"(../../types/alias.md)の作成をサポートしていたことを思い出してください。便利" +"なことに、特定の`Result`型に対しても定義することができます。" #: src/error/result/result_alias.md:7 msgid "" @@ -12255,10 +12669,10 @@ msgid "" "`std` library even supplies one: [`io::Result`](https://doc.rust-lang.org/" "std/io/type.Result.html)!" msgstr "" -"モジュールレベルでは、エイリアスの作成は非常に役に立ちます。" -"特定のモジュールで見られるエラーは同じ`Err`型を持つため、" -"単一のエイリアスで簡潔に`Results`に関わる*全て*を定義できます。" -"`std`ライブラリが提供するもの([`io::Result`](https://doc.rust-lang.org/std/io/type.Result.html))もあるほど有益なのです!" +"モジュールレベルでは、エイリアスの作成は非常に役に立ちます。特定のモジュール" +"で見られるエラーは同じ`Err`型を持つため、単一のエイリアスで簡潔に`Results`に" +"関わる*全て*を定義できます。`std`ライブラリが提供するもの([`io::Result`]" +"(https://doc.rust-lang.org/std/io/type.Result.html))もあるほど有益なのです!" #: src/error/result/result_alias.md:12 msgid "Here's a quick example to show off the syntax:" @@ -12268,7 +12682,9 @@ msgstr "簡単な例で構文を見てみましょう。" msgid "" "// Define a generic alias for a `Result` with the error type " "`ParseIntError`.\n" -msgstr "// `ParseIntError`を`Err`の型として持つ全ての`Result`のジェネリックエイリアス\n" +msgstr "" +"// `ParseIntError`を`Err`の型として持つ全ての`Result`のジェネリックエイリア" +"ス\n" #: src/error/result/result_alias.md:19 msgid "// Use the above alias to refer to our specific `Result` type.\n" @@ -12288,8 +12704,9 @@ msgid "" "Another way to deal with this case analysis is to use a combination of " "`match` statements and _early returns_." msgstr "" -"前の例では、コンビネータの活用によりエラーを明示的に処理しました。" -"場合分けに対する別の対処法として、`match`文と早期リターンを組み合わせて使うこともできます。" +"前の例では、コンビネータの活用によりエラーを明示的に処理しました。場合分けに" +"対する別の対処法として、`match`文と早期リターンを組み合わせて使うこともできま" +"す。" #: src/error/result/early_returns.md:7 msgid "" @@ -12298,9 +12715,10 @@ msgid "" "write. Consider this version of the previous example, rewritten using early " "returns:" msgstr "" -"つまり、エラーが発生した時点で関数の実行を止め、エラーを返してしまうという単純な方法が使えるということです。" -"この方法の方がより読みやすく書きやすい場合があります。" -"早期リターンを使って実装された、前の例の新たなバージョンを考えてみましょう。" +"つまり、エラーが発生した時点で関数の実行を止め、エラーを返してしまうという単" +"純な方法が使えるということです。この方法の方がより読みやすく書きやすい場合が" +"あります。早期リターンを使って実装された、前の例の新たなバージョンを考えてみ" +"ましょう。" #: src/error/result/early_returns.md:41 msgid "" @@ -12308,15 +12726,17 @@ msgid "" "and early returns. While we generally want to avoid panicking, explicitly " "handling all of our errors is cumbersome." msgstr "" -"ここまでで、コンビネータと早期リターンによる明示的なエラーハンドリングについて学びました。" -"しかし、パニックは一般に避けたいですが、全てのエラーを明示的に処理するのも厄介でしょう。" +"ここまでで、コンビネータと早期リターンによる明示的なエラーハンドリングについ" +"て学びました。しかし、パニックは一般に避けたいですが、全てのエラーを明示的に" +"処理するのも厄介でしょう。" #: src/error/result/early_returns.md:45 msgid "" "In the next section, we'll introduce `?` for the cases where we simply need " "to `unwrap` without possibly inducing `panic`." msgstr "" -"次の節では、`panic`を発生させずに`unwrap`する必要があるケースのための`?`について紹介していきます。" +"次の節では、`panic`を発生させずに`unwrap`する必要があるケースのための`?`につ" +"いて紹介していきます。" #: src/error/result/enter_question_mark.md:3 msgid "" @@ -12325,9 +12745,9 @@ msgid "" "what we really wanted was to get the variable _out_. This is exactly the " "purpose of `?`." msgstr "" -"時には`panic`の可能性を無視して、`unwrap`のシンプルさを活用したいこともあるでしょう。" -"今までの`unwrap`は、値を*取り出す*ためだけであろうとも、ネストを深く書くことを要求しました。" -"そして、これがまさに`?`の目的です。" +"時には`panic`の可能性を無視して、`unwrap`のシンプルさを活用したいこともあるで" +"しょう。今までの`unwrap`は、値を*取り出す*ためだけであろうとも、ネストを深く" +"書くことを要求しました。そして、これがまさに`?`の目的です。" #: src/error/result/enter_question_mark.md:7 msgid "Upon finding an `Err`, there are two valid actions to take:" @@ -12347,8 +12767,9 @@ msgid "" "instead of `panic`king on `Err`s. Let's see how we can simplify the earlier " "example that used combinators:" msgstr "" -"`?`は*ほぼ*[^†]まさしく、`Err`に対して`panic`するより`return`するという点で`unwrap`と同等です。" -"コンビネータを使った以前の例をどれだけ簡潔に書けるか見てみましょう。" +"`?`は*ほぼ*[^†]まさしく、`Err`に対して`panic`するより`return`するという点で" +"`unwrap`と同等です。コンビネータを使った以前の例をどれだけ簡潔に書けるか見て" +"みましょう。" #: src/error/result/enter_question_mark.md:39 msgid "The `try!` macro" @@ -12361,9 +12782,10 @@ msgid "" "when looking at older code. The same `multiply` function from the previous " "example would look like this using `try!`:" msgstr "" -"`?`ができる前、同様の動作を`try!`マクロによって行うことができました。" -"現在は`?`演算子が推奨されていますが、古いコードでは`try!`に出会うこともあります。" -"`try!`を使って前の例と同じ`multiply`関数を実装すると、以下のようになるでしょう。" +"`?`ができる前、同様の動作を`try!`マクロによって行うことができました。現在は`?" +"`演算子が推奨されていますが、古いコードでは`try!`に出会うこともあります。" +"`try!`を使って前の例と同じ`multiply`関数を実装すると、以下のようになるでしょ" +"う。" #: src/error/result/enter_question_mark.md:47 msgid "" @@ -12373,21 +12795,23 @@ msgid "" "file, to \"2015\".\n" msgstr "" "// Cargoを使いながらこの例をエラーなくコンパイル、及び実行する場合、\n" -"// `Cargo.toml`ファイル内、`[package]`セクションの`edition`の値を\"2015\"に変更してください。\n" +"// `Cargo.toml`ファイル内、`[package]`セクションの`edition`の値を\"2015\"に変" +"更してください。\n" #: src/error/result/enter_question_mark.md:73 msgid "" "See [re-enter ?](../multiple_error_types/reenter_question_mark.md) for more " "details." -msgstr "詳細は[re-enter ?](../multiple_error_types/reenter_question_mark.md)を参照。" +msgstr "" +"詳細は[re-enter ?](../multiple_error_types/reenter_question_mark.md)を参照。" #: src/error/multiple_error_types.md:3 msgid "" "The previous examples have always been very convenient; `Result`s interact " "with other `Result`s and `Option`s interact with other `Option`s." msgstr "" -"`Result`が他の`Result`と連携したり、`Option`が他の`Option`と連携するなど、" -"今までの例はとても便利な物でした。" +"`Result`が他の`Result`と連携したり、`Option`が他の`Option`と連携するなど、今" +"までの例はとても便利な物でした。" #: src/error/multiple_error_types.md:6 msgid "" @@ -12396,8 +12820,9 @@ msgid "" "want to manage our different error types in a way that makes them composable " "and easy to interact with." msgstr "" -"時には`Option`が`Result`と連携したり、`Result`が`Result`と連携する必要もあるでしょう。" -"そのような場面では、異なるエラー型を構成しやすく、かつ連携しやすく管理したいです。" +"時には`Option`が`Result`と連携したり、`Result`が`Result`と連携する必要もあるでしょう。そのような場面では、異なるエラー型を構" +"成しやすく、かつ連携しやすく管理したいです。" #: src/error/multiple_error_types.md:11 msgid "" @@ -12406,7 +12831,8 @@ msgid "" "`Result`:" msgstr "" "以下のコードは`unwrap`の2つのインスタンスが異なるエラー型を生成します。" -"`Vec::first`は`Option`を返し、一方で`parse::`は`Result`を返しています。" +"`Vec::first`は`Option`を返し、一方で`parse::`は`Result`を返しています。" #: src/error/multiple_error_types.md:17 msgid "// Generate error 1\n" @@ -12506,7 +12932,9 @@ msgstr "この先の節では、これらの問題を処理する方法につい msgid "" "The most basic way of handling mixed error types is to just embed them in " "each other." -msgstr "混在するエラー型に対する最も基本的な対処法は、単にお互いを埋め込んでしまうことです。" +msgstr "" +"混在するエラー型に対する最も基本的な対処法は、単にお互いを埋め込んでしまうこ" +"とです。" #: src/error/multiple_error_types/option_result.md:20 #: src/error/multiple_error_types/option_result.md:22 @@ -12524,24 +12952,26 @@ msgid "" "`None`. A couple of combinators come in handy to swap the `Result` and " "`Option`." msgstr "" -"中には、`Option`の中身が`None`の場合はそのまま処理を進め、" -"エラーの検出に限り実行を止めたいという場合もあるでしょう" -"([`?`](../result/enter_question_mark.md)を使った時のように)。" -"いくつかのコンビネータによって簡単に`Result`と`Option`をスワップすることができます。" +"中には、`Option`の中身が`None`の場合はそのまま処理を進め、エラーの検出に限り" +"実行を止めたいという場合もあるでしょう([`?`](../result/enter_question_mark." +"md)を使った時のように)。いくつかのコンビネータによって簡単に`Result`と" +"`Option`をスワップすることができます。" #: src/error/multiple_error_types/define_error_type.md:3 msgid "" "Sometimes it simplifies the code to mask all of the different errors with a " "single type of error. We'll show this with a custom error." msgstr "" -"異なるエラー型をマスクし単一のエラー型として扱えるようにすると、" -"コードがシンプルになる場合があります。ここでは自前のエラー型でそれを示してみます。" +"異なるエラー型をマスクし単一のエラー型として扱えるようにすると、コードがシン" +"プルになる場合があります。ここでは自前のエラー型でそれを示してみます。" #: src/error/multiple_error_types/define_error_type.md:6 msgid "" "Rust allows us to define our own error types. In general, a \"good\" error " "type:" -msgstr "Rustはユーザーによる新たなエラー型の定義をサポートします。一般に「良い」エラー型は、" +msgstr "" +"Rustはユーザーによる新たなエラー型の定義をサポートします。一般に「良い」エ" +"ラー型は、" #: src/error/multiple_error_types/define_error_type.md:8 msgid "Represents different errors with the same type" @@ -12562,7 +12992,8 @@ msgstr "良い例:`Err(EmptyVec)`" #: src/error/multiple_error_types/define_error_type.md:12 msgid "" "Bad: `Err(\"Please use a vector with at least one element\".to_owned())`" -msgstr "悪い例:`Err(\"Please use a vector with at least one element\".to_owned())`" +msgstr "" +"悪い例:`Err(\"Please use a vector with at least one element\".to_owned())`" #: src/error/multiple_error_types/define_error_type.md:13 msgid "Can hold information about the error" @@ -12588,7 +13019,8 @@ msgid "" "error\n" "// implementation, or do something in between.\n" msgstr "" -"// 自前のエラー型の定義。エラーハンドリングのケースの応じてカスタマイズできます。\n" +"// 自前のエラー型の定義。エラーハンドリングのケースの応じてカスタマイズできま" +"す。\n" "// ここで新たなエラーを書くことができ、元のエラーの実装に処理を委譲したり、\n" "// その手前で何らかの処理を挟むことができます。\n" @@ -12633,11 +13065,11 @@ msgid "" "determined](https://doc.rust-lang.org/book/ch17-02-trait-objects.html#trait-" "objects-perform-dynamic-dispatch)." msgstr "" -"元のエラーを維持しながらシンプルなコードを書くには、" -"[`Box`](https://doc.rust-lang.org/std/boxed/struct.Box.html)してしまうと良いでしょう。" -"欠点として、元のエラー型はランタイムまで判明せず、" -"[静的に決定](https://doc.rust-lang.org/book/ch17-02-trait-objects.html#trait-objects-perform-dynamic-dispatch)" -"されないことが挙げられます。" +"元のエラーを維持しながらシンプルなコードを書くには、[`Box`](https://doc.rust-" +"lang.org/std/boxed/struct.Box.html)してしまうと良いでしょう。欠点として、元の" +"エラー型はランタイムまで判明せず、[静的に決定](https://doc.rust-lang.org/" +"book/ch17-02-trait-objects.html#trait-objects-perform-dynamic-dispatch)されな" +"いことが挙げられます。" #: src/error/multiple_error_types/boxing_errors.md:7 msgid "" @@ -12646,9 +13078,10 @@ msgid "" "`Box`, via [`From`](https://doc.rust-lang.org/std/convert/trait.From." "html)." msgstr "" -"標準ライブラリは`Box`に、[`From`](https://doc.rust-lang.org/std/convert/trait.From.html)" -"を介してあらゆる`Error`トレイトを実装した型から`Box`トレイトオブジェクトへの変換を実装させることで、" -"エラーをboxしやすくしてくれます。" +"標準ライブラリは`Box`に、[`From`](https://doc.rust-lang.org/std/convert/" +"trait.From.html)を介してあらゆる`Error`トレイトを実装した型から`Box`ト" +"レイトオブジェクトへの変換を実装させることで、エラーをboxしやすくしてくれま" +"す。" #: src/error/multiple_error_types/boxing_errors.md:14 #: src/error/multiple_error_types/reenter_question_mark.md:28 @@ -12675,8 +13108,8 @@ msgid "" "Notice in the previous example that our immediate reaction to calling " "`parse` is to `map` the error from a library error into a boxed error:" msgstr "" -"以前の例では`parse`の呼び出しに対するその場での対応として、" -"エラーをライブラリのエラーからboxされたエラーへと`map`していました。" +"以前の例では`parse`の呼び出しに対するその場での対応として、エラーをライブラリ" +"のエラーからboxされたエラーへと`map`していました。" #: src/error/multiple_error_types/reenter_question_mark.md:12 msgid "" @@ -12684,8 +13117,9 @@ msgid "" "could be elided. Alas, because `and_then` is not sufficiently flexible, it " "cannot. However, we can instead use `?`." msgstr "" -"簡単でよくあるオペレーションのため、可能なら省略してしまえると便利だったでしょう。" -"でも残念、`and_then`が十分にフレキシブルでないため、それはできません。ただその代わり、`?`なら使えます。" +"簡単でよくあるオペレーションのため、可能なら省略してしまえると便利だったで" +"しょう。でも残念、`and_then`が十分にフレキシブルでないため、それはできませ" +"ん。ただその代わり、`?`なら使えます。" #: src/error/multiple_error_types/reenter_question_mark.md:16 msgid "" @@ -12695,18 +13129,19 @@ msgid "" "types, this means that if you `?` where the error is convertible to the " "return type, it will convert automatically." msgstr "" -"`?`の挙動は、`unwrap`または`return Err(err)`として説明されていました。" -"これはほぼ正解で、本当は`unwrap`、もしくは`return Err(From::from(err))`という意味があります。" -"`From::from`は異なる型の間での変換ユーティリティであることから、" -"エラーがリターン型に変換可能な場合に`?`を使うことで、その変換を自動的に行ってくれます。" +"`?`の挙動は、`unwrap`または`return Err(err)`として説明されていました。これは" +"ほぼ正解で、本当は`unwrap`、もしくは`return Err(From::from(err))`という意味が" +"あります。`From::from`は異なる型の間での変換ユーティリティであることから、エ" +"ラーがリターン型に変換可能な場合に`?`を使うことで、その変換を自動的に行ってく" +"れます。" #: src/error/multiple_error_types/reenter_question_mark.md:22 msgid "" "Here, we rewrite the previous example using `?`. As a result, the `map_err` " "will go away when `From::from` is implemented for our error type:" msgstr "" -"前の例を`?`を使ったものに書き換えてみましょう。" -"その結果、`From::from`がエラー型に実装されている時`map_err`は消えてなくなります。" +"前の例を`?`を使ったものに書き換えてみましょう。その結果、`From::from`がエラー" +"型に実装されている時`map_err`は消えてなくなります。" #: src/error/multiple_error_types/reenter_question_mark.md:42 msgid "" @@ -12722,10 +13157,9 @@ msgid "" "very similar to replacing the `unwrap` calls with `?` except that the return " "types are `Result`. As a result, they must be destructured at the top level." msgstr "" -"これでかなり綺麗になりました。" -"元の`panic`と比べ、リターン型が`Result`であることを除けば、" -"`unwrap`の呼び出しを`?`で置き換えたものに非常に似ています。" -"結果、その`Result`は上のレベルで分解されなければなりません。" +"これでかなり綺麗になりました。元の`panic`と比べ、リターン型が`Result`であるこ" +"とを除けば、`unwrap`の呼び出しを`?`で置き換えたものに非常に似ています。結果、" +"その`Result`は上のレベルで分解されなければなりません。" #: src/error/multiple_error_types/reenter_question_mark.md:76 msgid "" @@ -12733,13 +13167,15 @@ msgid "" "`](https://doc.rust-lang.org/reference/expressions/operator-expr.html#the-" "question-mark-operator)" msgstr "" -"[`From::from`](https://doc.rust-lang.org/std/convert/trait.From.html), [`?" -"`](https://doc.rust-lang.org/reference/expressions/operator-expr.html#the-" +"[`From::from`](https://doc.rust-lang.org/std/convert/trait.From.html), [`?`]" +"(https://doc.rust-lang.org/reference/expressions/operator-expr.html#the-" "question-mark-operator)" #: src/error/multiple_error_types/wrap_error.md:3 msgid "An alternative to boxing errors is to wrap them in your own error type." -msgstr "Boxする方法の代替として、エラーを自前のエラー型としてラップする方法もあります。" +msgstr "" +"Boxする方法の代替として、エラーを自前のエラー型としてラップする方法もありま" +"す。" #: src/error/multiple_error_types/wrap_error.md:16 msgid "" @@ -12747,7 +13183,8 @@ msgid "" " // Supplying extra info requires adding more data to the type.\n" msgstr "" "// パースエラーの実装まで処理を委譲します。\n" -" // 追加の情報を提供するには、型により多くのデータを追加する必要があります。\n" +" // 追加の情報を提供するには、型により多くのデータを追加する必要がありま" +"す。\n" #: src/error/multiple_error_types/wrap_error.md:25 msgid "\"please use a vector with at least one element\"" @@ -12774,7 +13211,8 @@ msgid "" msgstr "" "// 元の実装のエラー型が原因。\n" " // `&error::Error`トレイトオブジェクトに暗にキャストされます。\n" -" // 元となる型が`Error`トレイトをすでに実装しているため問題ありません。\n" +" // 元となる型が`Error`トレイトをすでに実装しているため問題ありま" +"せん。\n" #: src/error/multiple_error_types/wrap_error.md:45 msgid "" @@ -12803,17 +13241,22 @@ msgid "" "in all applications. There are some libraries that can take care of the " "boilerplate for you." msgstr "" -"これはエラーの処理のボイラープレートを増やしてしまい、" -"全てのアプリケーションで必要になる訳では無いでしょう。" -"これらのボイラープレートの処理を代わりにやってくれるようなライブラリもあります。" +"これはエラーの処理のボイラープレートを増やしてしまい、全てのアプリケーション" +"で必要になる訳では無いでしょう。これらのボイラープレートの処理を代わりにやっ" +"てくれるようなライブラリもあります。" #: src/error/multiple_error_types/wrap_error.md:93 msgid "" "[`From::from`](https://doc.rust-lang.org/std/convert/trait.From.html) and " "[`Enums`](../../custom_types/enum.md)" msgstr "" -"[`From::from`](https://doc.rust-lang.org/std/convert/trait.From.html), " -"[列挙型](../../custom_types/enum.md)" +"[`From::from`](https://doc.rust-lang.org/std/convert/trait.From.html), [列挙" +"型](../../custom_types/enum.md)" + +#: src/error/multiple_error_types/wrap_error.md:96 +msgid "" +"[`Crates for handling errors`](https://crates.io/keywords/error-handling)" +msgstr "" #: src/error/iter_result.md:3 msgid "An `Iter::map` operation might fail, for example:" @@ -12872,8 +13315,9 @@ msgid "" "(`Result, E>`). Once an `Result::Err` is found, the iteration will " "terminate." msgstr "" -"`Result`は、それらのベクタ(`Vec>`)からベクタのそれ(`Result, E>`)へと変換できるようにするため、" -"`FromIterator`を実装します。`Result::Err`が見つかり次第、イテレーションは終了します。" +"`Result`は、それらのベクタ(`Vec>`)からベクタのそれ" +"(`Result, E>`)へと変換できるようにするため、`FromIterator`を実装しま" +"す。`Result::Err`が見つかり次第、イテレーションは終了します。" #: src/error/iter_result.md:69 msgid "This same technique can be used with `Option`." @@ -12888,14 +13332,16 @@ msgid "" "When you look at the results, you'll note that everything is still wrapped " "in `Result`. A little more boilerplate is needed for this." msgstr "" -"結果を見てみると、まだ全て`Result`にラップされていることに気づくでしょう。" -"もう少しのボイラープレートが必要です。" +"結果を見てみると、まだ全て`Result`にラップされていることに気づくでしょう。も" +"う少しのボイラープレートが必要です。" #: src/std.md:3 msgid "" "The `std` library provides many custom types which expands drastically on " "the `primitives`. Some of these include:" -msgstr "`std`ライブラリは、基本データ型を劇的に拡張するカスタム型を数多く提供します。例えば以下です。" +msgstr "" +"`std`ライブラリは、基本データ型を劇的に拡張するカスタム型を数多く提供します。" +"例えば以下です。" #: src/std.md:6 msgid "growable `String`s like: `\"hello world\"`" @@ -12933,18 +13379,19 @@ msgid "" "destructor is called, the inner object is destroyed, and the memory on the " "heap is freed." msgstr "" -"Rustにおいて、すべての値はデフォルトでスタックに割り当てられます。" -"`Box`を作成することで、値を *ボックス化* 、すなわちヒープ上に割り当てることができます。" -"ボックスとは正確にはヒープ上におかれた`T`の値へのスマートポインタです。" -"ボックスがスコープを抜けると、デストラクタが呼ばれて内包するオブジェクトが破棄され、ヒープメモリが解放されます。" +"Rustにおいて、すべての値はデフォルトでスタックに割り当てられます。`Box`を" +"作成することで、値を *ボックス化* 、すなわちヒープ上に割り当てることができま" +"す。ボックスとは正確にはヒープ上におかれた`T`の値へのスマートポインタです。" +"ボックスがスコープを抜けると、デストラクタが呼ばれて内包するオブジェクトが破" +"棄され、ヒープメモリが解放されます。" #: src/std/box.md:8 msgid "" "Boxed values can be dereferenced using the `*` operator; this removes one " "layer of indirection. " msgstr "" -"ボックス化された値は`*`演算子を用いてデリファレンスすることができます。" -"これにより一段と直接的な操作が可能になります。" +"ボックス化された値は`*`演算子を用いてデリファレンスすることができます。これに" +"より一段と直接的な操作が可能になります。" #: src/std/box.md:20 msgid "" @@ -13014,9 +13461,9 @@ msgid "" "compile time, but they can grow or shrink at any time. A vector is " "represented using 3 parameters: " msgstr "" -"「ベクタ」はサイズを変更可能な配列です。スライスと同様、そのサイズはコンパイル時には不定ですが、" -"いつでも要素を追加したり削除したりすることができます。" -"ベクタは3つの要素で、その特徴が完全に決まります。" +"「ベクタ」はサイズを変更可能な配列です。スライスと同様、そのサイズはコンパイ" +"ル時には不定ですが、いつでも要素を追加したり削除したりすることができます。ベ" +"クタは3つの要素で、その特徴が完全に決まります。" #: src/std/vec.md:6 msgid "pointer to the data" @@ -13037,8 +13484,8 @@ msgid "" "this threshold needs to be surpassed, the vector is reallocated with a " "larger capacity." msgstr "" -"ベクタはその容量を超えない限りにおいて長くしていくことができます。" -"超えた場合には、より大きな容量を持つように割り当てなおされます。" +"ベクタはその容量を超えない限りにおいて長くしていくことができます。超えた場合" +"には、より大きな容量を持つように割り当てなおされます。" #: src/std/vec.md:16 msgid "// Iterators can be collected into vectors\n" @@ -13145,11 +13592,11 @@ msgid "" "More `Vec` methods can be found under the [std::vec](https://doc.rust-lang." "org/std/vec/) module" msgstr "" -"`Vec`型のメソッドの一覧は[std::vec](https://doc.rust-lang.org/std/vec/)" -"モジュールを見てください。" +"`Vec`型のメソッドの一覧は[std::vec](https://doc.rust-lang.org/std/vec/)モ" +"ジュールを見てください。" #: src/std/str.md:3 -msgid "There are two types of strings in Rust: `String` and `&str`." +msgid "The two most used string types in Rust are `String` and `&str`." msgstr "Rustには文字列を扱う型が2つあります。`String`と`&str`です。" #: src/std/str.md:5 @@ -13158,8 +13605,9 @@ msgid "" "always be a valid UTF-8 sequence. `String` is heap allocated, growable and " "not null terminated." msgstr "" -"`String`は有効なUTF-8の配列であることを保証されたバイトのベクタ(`Vec`)として保持されます。" -"ヒープ上に保持され、伸長可能で、末端にnull文字を含みません。" +"`String`は有効なUTF-8の配列であることを保証されたバイトのベクタ(`Vec`)と" +"して保持されます。ヒープ上に保持され、伸長可能で、末端にnull文字を含みませ" +"ん。" #: src/std/str.md:9 msgid "" @@ -13167,8 +13615,8 @@ msgid "" "and can be used to view into a `String`, just like `&[T]` is a view into " "`Vec`." msgstr "" -"`&str`は有効なUTF-8の配列のスライス(`&[u8]`)で、いつでも`String`に変換することができます。" -"`&[T]`がいつでも`Vec`に変換できるのと同様です。" +"`&str`は有効なUTF-8の配列のスライス(`&[u8]`)で、いつでも`String`に変換する" +"ことができます。`&[T]`がいつでも`Vec`に変換できるのと同様です。" #: src/std/str.md:14 msgid "" @@ -13188,7 +13636,8 @@ msgstr "\"Pangram: {}\"" #: src/std/str.md:19 msgid "// Iterate over words in reverse, no new string is allocated\n" -msgstr "// 単語を逆順にイテレートします。新しい文字列の割り当ては起こりません。\n" +msgstr "" +"// 単語を逆順にイテレートします。新しい文字列の割り当ては起こりません。\n" #: src/std/str.md:20 msgid "\"Words in reverse\"" @@ -13256,9 +13705,9 @@ msgid "" "rust-lang.org/std/str/) and [std::string](https://doc.rust-lang.org/std/" "string/) modules" msgstr "" -"`str`/`String`のメソッドをもっと見たい場合は" -"[std::str](https://doc.rust-lang.org/std/str/)、" -"[std::string](https://doc.rust-lang.org/std/string/)モジュールを参照してください。" +"`str`/`String`のメソッドをもっと見たい場合は[std::str](https://doc.rust-lang." +"org/std/str/)、[std::string](https://doc.rust-lang.org/std/string/)モジュール" +"を参照してください。" #: src/std/str.md:60 msgid "Literals and escapes" @@ -13348,7 +13797,7 @@ msgstr "r#\"And then I said: \"There is no escape!\"\"#" #: src/std/str.md:108 msgid "" "// If you need \"# in your string, just use more #s in the delimiter.\n" -" // You can use up to 65535 #s.\n" +" // You can use up to 255 #s.\n" msgstr "" #: src/std/str.md:110 @@ -13465,8 +13914,8 @@ msgid "" "instead of calling `panic!`; this can be accomplished using the `Option` " "enum." msgstr "" -"プログラムの一部が失敗した際、`panic!`するよりも、エラーを捕捉する方が望ましい場合があります。" -"これは`Option`という列挙型を用いることで可能になります。" +"プログラムの一部が失敗した際、`panic!`するよりも、エラーを捕捉する方が望まし" +"い場合があります。これは`Option`という列挙型を用いることで可能になります。" #: src/std/option.md:6 msgid "The `Option` enum has two variants:" @@ -13498,7 +13947,8 @@ msgstr "// この関数は失敗する割り算を扱うことができます。 #: src/std/option.md:25 msgid "// `Option` values can be pattern matched, just like other enums\n" -msgstr "// `Option` の値は、他のあらゆる列挙型と同様パターンマッチに使用できます。\n" +msgstr "" +"// `Option` の値は、他のあらゆる列挙型と同様パターンマッチに使用できます。\n" #: src/std/option.md:27 msgid "\"{} / {} failed!\"" @@ -13531,10 +13981,10 @@ msgid "" "However, sometimes it is important to express _why_ an operation failed. To " "do this we have the `Result` enum." msgstr "" -"これまでの例で、失敗する可能性のある関数の返り値として、列挙型`Option`が使用でき、" -"失敗時の返り値には`None`を用いることを見てきました。" -"しかし、時には **なぜ** そのオペレーションが失敗したのかを明示することが重要な場合があります。" -"そのためには`Result`列挙型を使用します。" +"これまでの例で、失敗する可能性のある関数の返り値として、列挙型`Option`が使用" +"でき、失敗時の返り値には`None`を用いることを見てきました。しかし、時には **な" +"ぜ** そのオペレーションが失敗したのかを明示することが重要な場合があります。そ" +"のためには`Result`列挙型を使用します。" #: src/std/result.md:8 msgid "The `Result` enum has two variants:" @@ -13545,15 +13995,17 @@ msgid "" "`Ok(value)` which indicates that the operation succeeded, and wraps the " "`value` returned by the operation. (`value` has type `T`)" msgstr "" -"`Ok(value)` ... これはオペレーションが成功したことを意味し、返り値`value`をラップします。(`value`は型`T`を持ちます。)" +"`Ok(value)` ... これはオペレーションが成功したことを意味し、返り値`value`を" +"ラップします。(`value`は型`T`を持ちます。)" #: src/std/result.md:12 msgid "" "`Err(why)`, which indicates that the operation failed, and wraps `why`, " "which (hopefully) explains the cause of the failure. (`why` has type `E`)" msgstr "" -"`Err(why)` ... これはオペレーションの失敗を意味します。" -"`why`をラップしており、ここには失敗した理由が(必ずではありませんが)書かれています。(`why`の型は`E`です。)" +"`Err(why)` ... これはオペレーションの失敗を意味します。`why`をラップしてお" +"り、ここには失敗した理由が(必ずではありませんが)書かれています。(`why`の型" +"は`E`です。)" #: src/std/result.md:17 msgid "// Mathematical \"errors\" we want to catch\n" @@ -13593,11 +14045,10 @@ msgid "" "where the `Err(err)` branch expands to an early `return Err(From::" "from(err))`, and the `Ok(ok)` branch expands to an `ok` expression." msgstr "" -"マッチを利用して結果をチェインするのは中々面倒です。" -"幸いなことに、`?`マクロを使用すればイケてるコードに戻すことができます。" -"`?`は`Result`を返す式の末尾で使います。" -"`Err(err)`の分岐が`return Err(From::from(err))`という早期リターンに展開され、" -"`Ok(ok)`の分岐が`ok`の式に展開されるようなマッチ式と等価です。" +"マッチを利用して結果をチェインするのは中々面倒です。幸いなことに、`?`マクロを" +"使用すればイケてるコードに戻すことができます。`?`は`Result`を返す式の末尾で使" +"います。`Err(err)`の分岐が`return Err(From::from(err))`という早期リターンに展" +"開され、`Ok(ok)`の分岐が`ok`の式に展開されるようなマッチ式と等価です。" #: src/std/result/question_mark.md:44 msgid "// Intermediate function\n" @@ -13609,7 +14060,8 @@ msgstr "// `div`が\"失敗\"したら、`DivisionByZero`が`return`されます #: src/std/result/question_mark.md:49 msgid "// if `ln` \"fails\", then `NonPositiveLogarithm` will be `return`ed\n" -msgstr "// もし`ln`が\"失敗\"したら、`NonPositiveLogarithm`が`return`されます。\n" +msgstr "" +"// もし`ln`が\"失敗\"したら、`NonPositiveLogarithm`が`return`されます。\n" #: src/std/result/question_mark.md:59 msgid "\"logarithm of non-positive number\"" @@ -13628,8 +14080,9 @@ msgid "" "Be sure to check the [documentation](https://doc.rust-lang.org/std/result/" "index.html), as there are many methods to map/compose `Result`." msgstr "" -"[公式ドキュメント](https://doc.rust-lang.org/std/result/index.html)をチェックすることをオススメします。" -"`Result`型を扱う関数や`Result`型のメソッドが多く挙げられています。" +"[公式ドキュメント](https://doc.rust-lang.org/std/result/index.html)をチェック" +"することをオススメします。`Result`型を扱う関数や`Result`型のメソッドが多く挙" +"げられています。" #: src/std/panic.md:3 msgid "" @@ -13637,15 +14090,18 @@ msgid "" "stack. While unwinding, the runtime will take care of freeing all the " "resources _owned_ by the thread by calling the destructor of all its objects." msgstr "" -"`panic!`マクロはパニックを生成し、スタックの巻き戻しを開始するために使用することができます。" -"巻き戻しの間、ランタイムは、(訳注: panicを起こした)スレッドが **所有権を持つ** 全ての資源のデストラクタを呼び出し、メモリ上から解放します。" +"`panic!`マクロはパニックを生成し、スタックの巻き戻しを開始するために使用する" +"ことができます。巻き戻しの間、ランタイムは、(訳注: panicを起こした)スレッド" +"が **所有権を持つ** 全ての資源のデストラクタを呼び出し、メモリ上から解放しま" +"す。" #: src/std/panic.md:7 msgid "" "Since we are dealing with programs with only one thread, `panic!` will cause " "the program to report the panic message and exit." msgstr "" -"今回はシングルスレッドのプログラムを実行しているので、`panic!`はプログラムにパニックメッセージを表示させ、exitします。" +"今回はシングルスレッドのプログラムを実行しているので、`panic!`はプログラムに" +"パニックメッセージを表示させ、exitします。" #: src/std/panic.md:11 msgid "// Re-implementation of integer division (/)\n" @@ -13686,9 +14142,9 @@ msgid "" "that implements the `Eq` and `Hash` traits. More on this in the next " "section." msgstr "" -"ベクタ型が値を整数のインデックスで保持するのに対し、`HashMap`ではキーで保持します。" -"`HashMap`のキーはブーリアン、整数、文字列等の`Eq`と`Hash`トレイトを保持する型なら何でもOKです。" -"次のセクションでより詳しく見ていきます。" +"ベクタ型が値を整数のインデックスで保持するのに対し、`HashMap`ではキーで保持し" +"ます。`HashMap`のキーはブーリアン、整数、文字列等の`Eq`と`Hash`トレイトを保持" +"する型なら何でもOKです。次のセクションでより詳しく見ていきます。" #: src/std/hash.md:8 msgid "" @@ -13698,9 +14154,10 @@ msgid "" "`HashMap::new()` to get a HashMap with a default initial capacity " "(recommended)." msgstr "" -"ベクタ型と同様、伸長可能ですが、`HashMap`の場合さらに、スペースが余っているときには小さくすることも可能です。" -"`HashMap`を一定の容量のエリアに作成するときは`HashMap::with_capacity(uint)`を、" -"デフォルトの容量で作成するときは`HashMap::new()`を用います。後者が推奨されています。" +"ベクタ型と同様、伸長可能ですが、`HashMap`の場合さらに、スペースが余っていると" +"きには小さくすることも可能です。`HashMap`を一定の容量のエリアに作成するときは" +"`HashMap::with_capacity(uint)`を、デフォルトの容量で作成するときは`HashMap::" +"new()`を用います。後者が推奨されています。" #: src/std/hash.md:19 src/std/hash.md:30 msgid "\"798-1364\"" @@ -13805,16 +14262,17 @@ msgid "" "tables) work, have a look at [Hash Table Wikipedia](https://en.wikipedia." "org/wiki/Hash_table)" msgstr "" -"ハッシングやハッシュマップ(ハッシュテーブルと呼ばれることもあります)の仕組みについて、" -"より詳しく知りたい場合は[Wikipediaのハッシュテーブルのページ](https://en.wikipedia.org/wiki/Hash_table)を見てください。" +"ハッシングやハッシュマップ(ハッシュテーブルと呼ばれることもあります)の仕組" +"みについて、より詳しく知りたい場合は[Wikipediaのハッシュテーブルのページ]" +"(https://en.wikipedia.org/wiki/Hash_table)を見てください。" #: src/std/hash/alt_key_types.md:3 msgid "" "Any type that implements the `Eq` and `Hash` traits can be a key in " "`HashMap`. This includes:" msgstr "" -"`Eq`と`Hash`トレイトを実装している型ならば、なんでも`HashMap`のキーになることができます。" -"例えば以下です。" +"`Eq`と`Hash`トレイトを実装している型ならば、なんでも`HashMap`のキーになること" +"ができます。例えば以下です。" #: src/std/hash/alt_key_types.md:6 msgid "`bool` (though not very useful since there are only two possible keys)" @@ -13828,7 +14286,9 @@ msgstr "`int`、`uint`、あるいは他の整数型" msgid "" "`String` and `&str` (protip: you can have a `HashMap` keyed by `String` and " "call `.get()` with an `&str`)" -msgstr "`String`と`&str`(Tips:`String`をキーにしたハッシュマップを作製した場合、`.get()`メソッドの引数に`&str`を与えて値を取得することができます。)" +msgstr "" +"`String`と`&str`(Tips:`String`をキーにしたハッシュマップを作製した場合、`." +"get()`メソッドの引数に`&str`を与えて値を取得することができます。)" #: src/std/hash/alt_key_types.md:11 msgid "" @@ -13837,9 +14297,10 @@ msgid "" "Floating_point#Accuracy_problems) would make using them as hashmap keys " "horribly error-prone." msgstr "" -"`f32`と`f64`は`Hash`を実装して **いない** ことに注意しましょう。" -"おそらくこれは[浮動小数点演算時に誤差が発生する](https://en.wikipedia.org/wiki/Floating_point#Accuracy_problems)" -"ため、キーとして使用すると、恐ろしいほどエラーの元となるためです。" +"`f32`と`f64`は`Hash`を実装して **いない** ことに注意しましょう。おそらくこれ" +"は[浮動小数点演算時に誤差が発生する](https://en.wikipedia.org/wiki/" +"Floating_point#Accuracy_problems)ため、キーとして使用すると、恐ろしいほどエ" +"ラーの元となるためです。" #: src/std/hash/alt_key_types.md:15 msgid "" @@ -13847,9 +14308,9 @@ msgid "" "also respectively implements `Eq` and `Hash`. For example, `Vec` will " "implement `Hash` if `T` implements `Hash`." msgstr "" -"集合型は、その要素となっている全ての型が`Eq`を、あるいは`Hash`を実装している場合、" -"必ず同じトレイトを実装しています。" -"例えば、`Vec`は`T`が`Hash`を実装している場合、`Hash`を実装します。" +"集合型は、その要素となっている全ての型が`Eq`を、あるいは`Hash`を実装している" +"場合、必ず同じトレイトを実装しています。例えば、`Vec`は`T`が`Hash`を実装し" +"ている場合、`Hash`を実装します。" #: src/std/hash/alt_key_types.md:19 msgid "" @@ -13865,16 +14326,17 @@ msgid "" "you can implement `Eq` and/or `Hash` yourself. This guide will not cover " "the specifics of implementing `Hash`. " msgstr "" -"後はコンパイラがよしなにしてくれます。" -"これらのトレイトの詳細をコントロールしたい場合、`Eq`や`Hash`を自分で実装することもできます。" -"この文書では`Hash`トレイトを実装する方法の詳細については触れません。" +"後はコンパイラがよしなにしてくれます。これらのトレイトの詳細をコントロールし" +"たい場合、`Eq`や`Hash`を自分で実装することもできます。この文書では`Hash`トレ" +"イトを実装する方法の詳細については触れません。" #: src/std/hash/alt_key_types.md:26 msgid "" "To play around with using a `struct` in `HashMap`, let's try making a very " "simple user logon system:" msgstr "" -"`struct`を`HashMap`で扱う際の例として、とてもシンプルなユーザーログインシステムを作成してみましょう。" +"`struct`を`HashMap`で扱う際の例として、とてもシンプルなユーザーログインシステ" +"ムを作成してみましょう。" #: src/std/hash/alt_key_types.md:31 msgid "// Eq requires that you derive PartialEq on the type.\n" @@ -13934,15 +14396,17 @@ msgid "" "Consider a `HashSet` as a `HashMap` where we just care about the keys " "( `HashSet` is, in actuality, just a wrapper around `HashMap`)." msgstr "" -"値がなく、キーだけの`HashMap`を想像してみてください。" -"これはハッシュ集合(`HashSet`)と呼ばれるものです。(`HashSet`は、実際には`HashMap`のラッパーです。)" +"値がなく、キーだけの`HashMap`を想像してみてください。これはハッシュ集合" +"(`HashSet`)と呼ばれるものです。(`HashSet`は、実際には`HashMap`の" +"ラッパーです。)" #: src/std/hash/hashset.md:6 msgid "" "\"What's the point of that?\" you ask. \"I could just store the keys in a " "`Vec`.\"" msgstr "" -"「何の意味があるの?フツーにキーを`Vec`に入れればいいじゃん」そう思いましたね?" +"「何の意味があるの?フツーにキーを`Vec`に入れればいいじゃん」そう思いました" +"ね?" #: src/std/hash/hashset.md:8 msgid "" @@ -13951,9 +14415,10 @@ msgid "" "is just one implementation. (see also: [`BTreeSet`](https://doc.rust-lang." "org/std/collections/struct.BTreeSet.html))" msgstr "" -"それは、`HashSet`独自の機能として、要素に重複がないということが保証されるためです。" -"これは全ての集合型がもつ機能です。`HashSet`はその実装の1つであり、" -"他には[`BTreeSet`](https://doc.rust-lang.org/std/collections/struct.BTreeSet.html)等があります。" +"それは、`HashSet`独自の機能として、要素に重複がないということが保証されるため" +"です。これは全ての集合型がもつ機能です。`HashSet`はその実装の1つであり、他に" +"は[`BTreeSet`](https://doc.rust-lang.org/std/collections/struct.BTreeSet." +"html)等があります。" #: src/std/hash/hashset.md:13 msgid "" @@ -13961,15 +14426,17 @@ msgid "" "new value is equal to the existing and they both have the same hash), then " "the new value will replace the old." msgstr "" -"`HashSet`に、すでに存在する値を加えようとすると、" -"(すなわち、加えようとしている値のハッシュ値と、要素中のいずれかの値のハッシュ値が等しい場合、)" -"新しい値によって古い値が上書きされます。" +"`HashSet`に、すでに存在する値を加えようとすると、(すなわち、加えようとしてい" +"る値のハッシュ値と、要素中のいずれかの値のハッシュ値が等しい場合、)新しい値" +"によって古い値が上書きされます。" #: src/std/hash/hashset.md:17 msgid "" "This is great for when you never want more than one of something, or when " "you want to know if you've already got something." -msgstr "これは、同じ値を2つ以上欲しくない場合や、すでにある値を持っているか知りたい場合にとても有効です。" +msgstr "" +"これは、同じ値を2つ以上欲しくない場合や、すでにある値を持っているか知りたい場" +"合にとても有効です。" #: src/std/hash/hashset.md:20 msgid "But sets can do more than that. " @@ -13999,7 +14466,9 @@ msgstr "`intersection`:両方の集合にある値のみを取得。" msgid "" "`symmetric_difference`: get all the elements that are in one set or the " "other, but _not_ both." -msgstr "`symmetric_difference`:どちらか一方の集合には存在するが、両方には **ない** 値を取得。" +msgstr "" +"`symmetric_difference`:どちらか一方の集合には存在するが、両方には **ない** " +"値を取得。" #: src/std/hash/hashset.md:33 msgid "Try all of these in the following example:" @@ -14072,8 +14541,8 @@ msgid "" "(Examples are adapted from the [documentation.](https://doc.rust-lang.org/" "std/collections/struct.HashSet.html#method.difference))" msgstr "" -"例は[公式ドキュメント](https://doc.rust-lang.org/std/collections/struct.HashSet.html#method.difference)" -"から持ってきています。" +"例は[公式ドキュメント](https://doc.rust-lang.org/std/collections/struct." +"HashSet.html#method.difference)から持ってきています。" #: src/std/rc.md:3 msgid "" @@ -14200,19 +14669,22 @@ msgstr "" msgid "" "Many other types are provided by the std library to support things such as:" msgstr "" -"他にも、様々な型がstdライブラリの中で提供されています。例えば以下の機能を果たすための物があります。" +"他にも、様々な型がstdライブラリの中で提供されています。例えば以下の機能を果た" +"すための物があります。" #: src/std_misc.md:10 msgid "These expand beyond what the [primitives](primitives.md) provide." -msgstr "これらにより[基本データ型](primitives.md)の提供する機能よりも遥かに豊かなことが実現できます。" +msgstr "" +"これらにより[基本データ型](primitives.md)の提供する機能よりも遥かに豊かなこと" +"が実現できます。" #: src/std_misc/threads.md:3 msgid "" "Rust provides a mechanism for spawning native OS threads via the `spawn` " "function, the argument of this function is a moving closure." msgstr "" -"Rustは`spawn`関数を用いてOSのネイティブスレッドを開始することができます。" -"この関数の引数はmoveクロージャ(訳注: 参照ではなく値を取るクロージャ)です。" +"Rustは`spawn`関数を用いてOSのネイティブスレッドを開始することができます。この" +"関数の引数はmoveクロージャ(訳注: 参照ではなく値を取るクロージャ)です。" #: src/std_misc/threads.md:10 src/std_misc/threads/testcase_mapreduce.md:28 msgid "// This is the `main` thread\n" @@ -14446,8 +14918,8 @@ msgid "" "[`move` closures](https://doc.rust-lang.org/book/ch13-01-closures." "html#closures-can-capture-their-environment)" msgstr "" -"[クロージャ](../../fn/closures.md), [move](../../scope/move.md) semantics and " -"[`move` クロージャ](https://doc.rust-lang.org/book/ch13-01-closures." +"[クロージャ](../../fn/closures.md), [move](../../scope/move.md) semantics " +"and [`move` クロージャ](https://doc.rust-lang.org/book/ch13-01-closures." "html#closures-can-capture-their-environment)" #: src/std_misc/threads/testcase_mapreduce.md:132 @@ -14463,8 +14935,8 @@ msgid "" "[turbofish notation](https://doc.rust-lang.org/book/appendix-02-operators." "html?highlight=turbofish) to help type inference" msgstr "" -"型推論を補助する [ターボフィッシュ記法](https://doc.rust-lang.org/book/appendix-02-operators." -"html?highlight=turbofish)" +"型推論を補助する [ターボフィッシュ記法](https://doc.rust-lang.org/book/" +"appendix-02-operators.html?highlight=turbofish)" #: src/std_misc/threads/testcase_mapreduce.md:134 msgid "[unwrap vs. expect](../../error/option_unwrap.md)" @@ -14480,8 +14952,9 @@ msgid "" "Channels allow a unidirectional flow of information between two end-points: " "the `Sender` and the `Receiver`." msgstr "" -"Rustは、スレッド間のコミュニケーションのために、非同期のチャネルを提供しています。" -"チャネルは2つのエンドポイント、すなわち送信者と受信者を介して、情報の一方向への流れを作り出すことを可能にしています。" +"Rustは、スレッド間のコミュニケーションのために、非同期のチャネルを提供してい" +"ます。チャネルは2つのエンドポイント、すなわち送信者と受信者を介して、情報の一" +"方向への流れを作り出すことを可能にしています。" #: src/std_misc/channels.md:15 msgid "" @@ -14489,7 +14962,8 @@ msgid "" " // where `T` is the type of the message to be transferred\n" " // (type annotation is superfluous)\n" msgstr "" -"// チャネルには`Sender`と`Receiver`という2つのエンドポイントがあります。\n" +"// チャネルには`Sender`と`Receiver`という2つのエンドポイントがありま" +"す。\n" " // ここで、`T`は送信されるメッセージの型です。\n" " // (型アノテーションは必須ではありません。)\n" @@ -14554,17 +15028,18 @@ msgid "" "`windows::Path`, for Windows. The prelude exports the appropriate platform-" "specific `Path` variant." msgstr "" -"構造体`Path`は、ファイルシステム中のパスを表します。`Path`には2つの変種があります。" -"UNIXライクなファイルシステムのための`posix::Path`と、Windows用の`windows::Path`です。" -"それぞれプラットフォームに対応した`Path`をエクスポートします。" +"構造体`Path`は、ファイルシステム中のパスを表します。`Path`には2つの変種があり" +"ます。UNIXライクなファイルシステムのための`posix::Path`と、Windows用の" +"`windows::Path`です。それぞれプラットフォームに対応した`Path`をエクスポートし" +"ます。" #: src/std_misc/path.md:8 msgid "" "A `Path` can be created from an `OsStr`, and provides several methods to get " "information from the file/directory the path points to." msgstr "" -"`Path`は`OsStr`から作ることができます。" -"そうすればそのパスが指すファイル・ディレクトリの情報を取得するためのメソッドがいくつか使えるようになります。" +"`Path`は`OsStr`から作ることができます。そうすればそのパスが指すファイル・ディ" +"レクトリの情報を取得するためのメソッドがいくつか使えるようになります。" #: src/std_misc/path.md:11 msgid "" @@ -14574,8 +15049,8 @@ msgid "" "`Path`." msgstr "" "`Path`はイミュータブルです。`Path`の所有権ありのバージョンが`PathBuf`です。" -"`Path`と`PathBuf`の関係は、`str`と`String`の関係に似ています。" -"`PathBuf`はそのまま変更でき、`Path`にデリファレンスすることができます。" +"`Path`と`PathBuf`の関係は、`str`と`String`の関係に似ています。`PathBuf`はその" +"まま変更でき、`Path`にデリファレンスすることができます。" #: src/std_misc/path.md:15 msgid "" @@ -14585,9 +15060,11 @@ msgid "" "`Path` can be freely converted to an `OsString` or `&OsStr` using " "`into_os_string` and `as_os_str`, respectively." msgstr "" -"`Path`の実態はUTF-8の文字列 **ではなく** 、`OsString`であることに注意しましょう。" -"したがって、`Path`を`&str`に変換するのは無条件 **ではなく** 、失敗する可能性があります。それゆえ`Option`型が返されます。" -"しかし`Path`から`OsString`あるいは`&OsStr`への変換はそれぞれ`into_os_string`と`as_os_str`によって無条件でできます。" +"`Path`の実態はUTF-8の文字列 **ではなく** 、`OsString`であることに注意しましょ" +"う。したがって、`Path`を`&str`に変換するのは無条件 **ではなく** 、失敗する可" +"能性があります。それゆえ`Option`型が返されます。しかし`Path`から`OsString`あ" +"るいは`&OsStr`への変換はそれぞれ`into_os_string`と`as_os_str`によって無条件で" +"できます。" #: src/std_misc/path.md:25 msgid "// Create a `Path` from an `&'static str`\n" @@ -14642,8 +15119,8 @@ msgid "" "Be sure to check at other `Path` methods (`posix::Path` or `windows::Path`) " "and the `Metadata` struct." msgstr "" -"他の`Path`メソッド(`posix::Path`と`windows::Path`)をチェックするのを忘れずに!" -"それと`Metadata`構造体も見ておくことをオススメします。" +"他の`Path`メソッド(`posix::Path`と`windows::Path`)をチェックするのを忘れず" +"に!それと`Metadata`構造体も見ておくことをオススメします。" #: src/std_misc/path.md:56 msgid "" @@ -14658,8 +15135,8 @@ msgid "" "The `File` struct represents a file that has been opened (it wraps a file " "descriptor), and gives read and/or write access to the underlying file." msgstr "" -"`File`構造体は開かれたファイルを表し(実際にはファイルディスクリプタのラッパーです)、" -"読み込み・書き込み権限のどちらか一方、あるいは両方を提供します。" +"`File`構造体は開かれたファイルを表し(実際にはファイルディスクリプタのラッ" +"パーです)、読み込み・書き込み権限のどちらか一方、あるいは両方を提供します。" #: src/std_misc/file.md:6 msgid "" @@ -14674,20 +15151,22 @@ msgid "" "programmer can see all the failure paths, and is encouraged to handle them " "in a proactive manner." msgstr "" -"これはI/Oに関するオペレーションの失敗をより明瞭にします。" -"このおかげでプログラマは直面した失敗を全て見ることができ、より生産的な方法でそれらを扱うことが可能になります。" +"これはI/Oに関するオペレーションの失敗をより明瞭にします。このおかげでプログラ" +"マは直面した失敗を全て見ることができ、より生産的な方法でそれらを扱うことが可" +"能になります。" #: src/std_misc/file/open.md:3 msgid "The `open` function can be used to open a file in read-only mode." -msgstr "`open`関数を用いることで読み込み専用モードでファイルを開くことが可能です。" +msgstr "" +"`open`関数を用いることで読み込み専用モードでファイルを開くことが可能です。" #: src/std_misc/file/open.md:5 msgid "" "A `File` owns a resource, the file descriptor and takes care of closing the " "file when it is `drop`ed." msgstr "" -"`File`はファイルディスクリプタという資源を保持しており、" -"`drop`時にはファイルを閉じるところまで面倒を見てくれます。" +"`File`はファイルディスクリプタという資源を保持しており、`drop`時にはファイル" +"を閉じるところまで面倒を見てくれます。" #: src/std_misc/file/open.md:14 msgid "// Create a path to the desired file\n" @@ -14699,7 +15178,8 @@ msgstr "\"hello.txt\"" #: src/std_misc/file/open.md:18 msgid "// Open the path in read-only mode, returns `io::Result`\n" -msgstr "// pathを読み込み専用モードで開きます。これは`io::Result`を返します。\n" +msgstr "" +"// pathを読み込み専用モードで開きます。これは`io::Result`を返します。\n" #: src/std_misc/file/open.md:20 msgid "\"couldn't open {}: {}\"" @@ -14707,7 +15187,8 @@ msgstr "\"couldn't open {}: {}\"" #: src/std_misc/file/open.md:24 msgid "// Read the file contents into a string, returns `io::Result`\n" -msgstr "// ファイルの中身を文字列に読み込みます。`io::Result`を返します。\n" +msgstr "" +"// ファイルの中身を文字列に読み込みます。`io::Result`を返します。\n" #: src/std_misc/file/open.md:27 msgid "\"couldn't read {}: {}\"" @@ -14747,16 +15228,17 @@ msgid "" "(You are encouraged to test the previous example under different failure " "conditions: `hello.txt` doesn't exist, or `hello.txt` is not readable, etc.)" msgstr "" -"(気が向いたなら、上記の例を様々な形で失敗させてみましょう。" -"例えば`hello.txt`が存在しないとか、読み込み権限がないとか、そういった状況で実行してみてください。)" +"(気が向いたなら、上記の例を様々な形で失敗させてみましょう。例えば`hello.txt`" +"が存在しないとか、読み込み権限がないとか、そういった状況で実行してみてくださ" +"い。)" #: src/std_misc/file/create.md:3 msgid "" "The `create` function opens a file in write-only mode. If the file already " "existed, the old content is destroyed. Otherwise, a new file is created." msgstr "" -"`create`関数はファイルを書き込み専用モードで開きます。" -"すでにファイルが存在している場合、破棄して新しい物を作成します。" +"`create`関数はファイルを書き込み専用モードで開きます。すでにファイルが存在し" +"ている場合、破棄して新しい物を作成します。" #: src/std_misc/file/create.md:9 msgid "" @@ -14786,7 +15268,8 @@ msgstr "\"lorem_ipsum.txt\"" #: src/std_misc/file/create.md:25 msgid "// Open a file in write-only mode, returns `io::Result`\n" -msgstr "// ファイルを書き込み専用モードで開きます。返り値は`io::Result`。\n" +msgstr "" +"// ファイルを書き込み専用モードで開きます。返り値は`io::Result`。\n" #: src/std_misc/file/create.md:27 msgid "\"couldn't create {}: {}\"" @@ -14794,7 +15277,8 @@ msgstr "\"couldn't create {}: {}\"" #: src/std_misc/file/create.md:31 msgid "// Write the `LOREM_IPSUM` string to `file`, returns `io::Result<()>`\n" -msgstr "// `LOREM_IPSUM`の文字列を`file`に書き込みます。返り値は`io::Result<()>`。\n" +msgstr "" +"// `LOREM_IPSUM`の文字列を`file`に書き込みます。返り値は`io::Result<()>`。\n" #: src/std_misc/file/create.md:33 msgid "\"couldn't write to {}: {}\"" @@ -14808,15 +15292,16 @@ msgstr "\"successfully wrote to {}\"" msgid "" "(As in the previous example, you are encouraged to test this example under " "failure conditions.)" -msgstr "前項の例と同じように、様々な失敗パターンをためしてみることをオススメします。" +msgstr "" +"前項の例と同じように、様々な失敗パターンをためしてみることをオススメします。" #: src/std_misc/file/create.md:56 msgid "" "The [`OpenOptions`](https://doc.rust-lang.org/std/fs/struct.OpenOptions." "html) struct can be used to configure how a file is opened." msgstr "" -"[`OpenOptions`](https://doc.rust-lang.org/std/fs/struct.OpenOptions.html)" -"構造体を利用して、ファイルの開き方を設定できます。" +"[`OpenOptions`](https://doc.rust-lang.org/std/fs/struct.OpenOptions.html)構造" +"体を利用して、ファイルの開き方を設定できます。" #: src/std_misc/file/read_lines.md:3 msgid "A naive approach" @@ -14827,8 +15312,8 @@ msgid "" "This might be a reasonable first attempt for a beginner's first " "implementation for reading lines from a file." msgstr "" -"テキストファイルの行を読み込むのを、初心者が初めて実装した場合、" -"以下のようになるでしょう。" +"テキストファイルの行を読み込むのを、初心者が初めて実装した場合、以下のように" +"なるでしょう。" #: src/std_misc/file/read_lines.md:22 msgid "" @@ -14836,9 +15321,9 @@ msgid "" "we can also perform a map inline and collect the results, yielding a more " "concise and fluent expression." msgstr "" -"`lines()`メソッドはファイルの各行のイテレータを返すので、" -"インラインでマップを実行し結果を収集することもできます。" -"そうすると、より簡潔で読みやすい表現となります。" +"`lines()`メソッドはファイルの各行のイテレータを返すので、インラインでマップを" +"実行し結果を収集することもできます。そうすると、より簡潔で読みやすい表現とな" +"ります。" #: src/std_misc/file/read_lines.md:31 msgid "// panic on possible file-reading errors\n" @@ -14862,9 +15347,9 @@ msgid "" "returned from `lines()` to the owned type `String`, using `.to_string()` and " "`String::from` respectively." msgstr "" -"上の例では、`lines()`から返された`&str`を" -"それぞれ`to_string()`と`String::from`を使って、" -"所有権のある`String`型に変換しなければならない点に注意してください。" +"上の例では、`lines()`から返された`&str`をそれぞれ`to_string()`と`String::" +"from`を使って、所有権のある`String`型に変換しなければならない点に注意してくだ" +"さい。" #: src/std_misc/file/read_lines.md:42 msgid "A more efficient approach" @@ -14875,16 +15360,16 @@ msgid "" "Here we pass ownership of the open `File` to a `BufReader` struct. " "`BufReader` uses an internal buffer to reduce intermediate allocations." msgstr "" -"ここでは、開いた`File`の所有権を`BufReader`構造体に渡します。" -"`BufReader`は内部的なバッファを使い、中間のメモリ割り当てを削減します。" +"ここでは、開いた`File`の所有権を`BufReader`構造体に渡します。`BufReader`は内" +"部的なバッファを使い、中間のメモリ割り当てを削減します。" #: src/std_misc/file/read_lines.md:47 msgid "" "We also update `read_lines` to return an iterator instead of allocating new " "`String` objects in memory for each line." msgstr "" -"`read_lines`を更新して、それぞれの行に対してメモリ上に新しい`String`オブジェクトを割り当てるのではなく、" -"イテレータを返すようにします。" +"`read_lines`を更新して、それぞれの行に対してメモリ上に新しい`String`オブジェ" +"クトを割り当てるのではなく、イテレータを返すようにします。" #: src/std_misc/file/read_lines.md:56 msgid "// File hosts.txt must exist in the current path\n" @@ -14932,8 +15417,9 @@ msgid "" "we define our generic `read_lines()` method with the same generic " "constraint, using the `where` keyword.)" msgstr "" -"`File::open`はジェネリックな`AsRef`を引数にとるので、" -"ジェネリックな`read_lines`メソッドも、`where`キーワードを使って、同じジェネリックな制約を持たせています。" +"`File::open`はジェネリックな`AsRef`を引数にとるので、ジェネリックな" +"`read_lines`メソッドも、`where`キーワードを使って、同じジェネリックな制約を持" +"たせています。" #: src/std_misc/file/read_lines.md:85 msgid "" @@ -14941,16 +15427,17 @@ msgid "" "of the file's contents. This can especially cause performance issues when " "working with larger files." msgstr "" -"この処理は、ファイルの中身全てをメモリ上の`String`にするよりも効率的です。" -"メモリ上に`String`を作ると、より大きなファイルを取り扱う際に、パフォーマンスの問題につながります。" +"この処理は、ファイルの中身全てをメモリ上の`String`にするよりも効率的です。メ" +"モリ上に`String`を作ると、より大きなファイルを取り扱う際に、パフォーマンスの" +"問題につながります。" #: src/std_misc/process.md:3 msgid "" "The `process::Output` struct represents the output of a finished child " "process, and the `process::Command` struct is a process builder." msgstr "" -"`process::Output`構造体は終了したプロセスのアウトプットを表し、" -"`process::Command`構造体はプロセスの作成を行います。" +"`process::Output`構造体は終了したプロセスのアウトプットを表し、`process::" +"Command`構造体はプロセスの作成を行います。" #: src/std_misc/process.md:10 msgid "\"rustc\"" @@ -14976,7 +15463,9 @@ msgstr "\"rustc failed and stderr was:\\n{}\"" msgid "" "(You are encouraged to try the previous example with an incorrect flag " "passed to `rustc`)" -msgstr "(余裕があれば、上の例で`rustc`に不正なフラグを渡し、どうなるか見てみましょう)" +msgstr "" +"(余裕があれば、上の例で`rustc`に不正なフラグを渡し、どうなるか見てみましょ" +"う)" #: src/std_misc/process/pipe.md:3 msgid "" @@ -14984,12 +15473,12 @@ msgid "" "`stdin`, `stdout` and `stderr` handles for interaction with the underlying " "process via pipes." msgstr "" -"`std::Child`構造体は実行中の子プロセスを表します。" -"`stdin`、`stdout`、`stderr`を介して表面化のプロセスとのやり取りを仲介します。" +"`std::Child`構造体は実行中の子プロセスを表します。`stdin`、`stdout`、`stderr`" +"を介して表面化のプロセスとのやり取りを仲介します。" #: src/std_misc/process/pipe.md:11 -msgid "\"the quick brown fox jumped over the lazy dog\\n\"" -msgstr "\"the quick brown fox jumped over the lazy dog\\n\"" +msgid "\"the quick brown fox jumps over the lazy dog\\n\"" +msgstr "\"the quick brown fox jumps over the lazy dog\\n\"" #: src/std_misc/process/pipe.md:15 msgid "// Spawn the `wc` command\n" @@ -15030,7 +15519,8 @@ msgid "" msgstr "" "// `wc`の`stdin`に文字列を書き込みます。\n" " //\n" -" // `stdin`は`Option`型を持ちますが、今回は値を持っていることが\n" +" // `stdin`は`Option`型を持ちますが、今回は値を持っていること" +"が\n" " // 確かなので、いきなり`unwrap`してしまって構いません。\n" #: src/std_misc/process/pipe.md:36 @@ -15059,7 +15549,9 @@ msgstr "" msgid "" "// The `stdout` field also has type `Option` so must be " "unwrapped.\n" -msgstr "// `stdout`フィールドも`Option`型なのでアンラップする必要があります\n" +msgstr "" +"// `stdout`フィールドも`Option`型なのでアンラップする必要があり" +"ます\n" #: src/std_misc/process/pipe.md:49 msgid "\"couldn't read wc stdout: {}\"" @@ -15074,8 +15566,8 @@ msgid "" "If you'd like to wait for a `process::Child` to finish, you must call " "`Child::wait`, which will return a `process::ExitStatus`." msgstr "" -"`process::Child`が終了するのを待ちたい場合は、" -"`process::ExitStatus`を返す`Child::wait`を呼び出さなくてはなりません。" +"`process::Child`が終了するのを待ちたい場合は、`process::ExitStatus`を返す" +"`Child::wait`を呼び出さなくてはなりません。" #: src/std_misc/process/wait.md:10 msgid "\"sleep\"" @@ -15095,7 +15587,8 @@ msgid "" "The `std::fs` module contains several functions that deal with the " "filesystem." msgstr "" -"`std::fs`モジュールはファイルシステムとやり取りするための関数をいくつか持っています。" +"`std::fs`モジュールはファイルシステムとやり取りするための関数をいくつか持って" +"います。" #: src/std_misc/fs.md:10 src/std_misc/fs.md:68 src/std_misc/ffi.md:20 msgid "\"unix\"" @@ -15111,7 +15604,8 @@ msgstr "// `% echo s > path`の簡単な実装\n" #: src/std_misc/fs.md:32 msgid "// A simple implementation of `% touch path` (ignores existing files)\n" -msgstr "// `% touch path`の簡単な実装(すでにファイルが存在しても無視します。)\n" +msgstr "" +"// `% touch path`の簡単な実装(すでにファイルが存在しても無視します。)\n" #: src/std_misc/fs.md:42 msgid "\"`mkdir a`\"" @@ -15187,7 +15681,8 @@ msgstr "\"`ls a`\"" #: src/std_misc/fs.md:86 msgid "// Read the contents of a directory, returns `io::Result>`\n" -msgstr "// ディレクトリの内容を読み込みます。返り値は`io::Result>`。\n" +msgstr "" +"// ディレクトリの内容を読み込みます。返り値は`io::Result>`。\n" #: src/std_misc/fs.md:94 msgid "\"`rm a/c/e.txt`\"" @@ -15260,8 +15755,8 @@ msgid "" "The command line arguments can be accessed using `std::env::args`, which " "returns an iterator that yields a `String` for each argument:" msgstr "" -"コマンドライン引数は`std::env::args`を介して取得できます。" -"これはそれぞれの引数を文字列として生成するイテレータを返します。" +"コマンドライン引数は`std::env::args`を介して取得できます。これはそれぞれの引" +"数を文字列として生成するイテレータを返します。" #: src/std_misc/arg.md:14 msgid "// The first argument is the path that was used to call the program.\n" @@ -15393,9 +15888,10 @@ msgid "" "functions must be declared inside an `extern` block annotated with a " "`#[link]` attribute containing the name of the foreign library." msgstr "" -"RustはCのライブラリを呼び出すために他言語関数インターフェイス(Foreign Function Interface, FFI)を持っています。" -"他言語の関数を使用する際には、そのライブラリ名を`#[link]`アトリビュートに渡し、" -"更にそれでアノテーションされた`extern`ブロック内で宣言する必要があります。" +"RustはCのライブラリを呼び出すために他言語関数インターフェイス(Foreign " +"Function Interface, FFI)を持っています。他言語の関数を使用する際には、そのラ" +"イブラリ名を`#[link]`アトリビュートに渡し、更にそれでアノテーションされた" +"`extern`ブロック内で宣言する必要があります。" #: src/std_misc/ffi.md:9 msgid "// this extern block links to the libm library\n" @@ -15460,8 +15956,8 @@ msgid "" "Rust is a programming language that cares a lot about correctness and it " "includes support for writing software tests within the language itself." msgstr "" -"Rustはとても正確性を配慮したプログラミング言語であり、" -"ソフトウェアテストを書くためのサポートを言語自身が含んでいます。" +"Rustはとても正確性を配慮したプログラミング言語であり、ソフトウェアテストを書" +"くためのサポートを言語自身が含んでいます。" #: src/testing.md:6 msgid "Testing comes in three styles:" @@ -15481,7 +15977,8 @@ msgstr "[結合テスト](testing/integration_testing.md)" #: src/testing.md:12 msgid "Also Rust has support for specifying additional dependencies for tests:" -msgstr "またRustではテストのために追加の依存パッケージを指定することもできます。" +msgstr "" +"またRustではテストのために追加の依存パッケージを指定することもできます。" #: src/testing.md:14 msgid "[Dev-dependencies](testing/dev_dependencies.md)" @@ -15491,7 +15988,8 @@ msgstr "" msgid "" "[The Book](https://doc.rust-lang.org/book/ch11-00-testing.html) chapter on " "testing" -msgstr "[The Book](https://doc.rust-lang.org/book/ch11-00-testing.html) のテストの章" +msgstr "" +"[The Book](https://doc.rust-lang.org/book/ch11-00-testing.html) のテストの章" #: src/testing.md:19 msgid "" @@ -15506,8 +16004,9 @@ msgid "" "setup, run the code we want to test, then assert whether the results are " "what we expect." msgstr "" -"テストは、テスト以外のコードが想定通りに動いているかを確かめるRustの関数です。" -"一般にテスト関数は、準備をしてからテストしたいコードを実行し、そしてその結果が期待したものであるか確認します。" +"テストは、テスト以外のコードが想定通りに動いているかを確かめるRustの関数で" +"す。一般にテスト関数は、準備をしてからテストしたいコードを実行し、そしてその" +"結果が期待したものであるか確認します。" #: src/testing/unit_testing.md:8 msgid "" @@ -15515,27 +16014,30 @@ msgid "" "[attribute](../attribute.md). Test functions are marked with the `#[test]` " "attribute." msgstr "" -"大抵の場合ユニットテストは`#[cfg(test)]`[アトリビュート](../attribute.md)" -"を付けた`tests`[モジュール](../mod.md)に配置されます。" -"テスト関数には`#[test]`アトリビュートを付与します。" +"大抵の場合ユニットテストは`#[cfg(test)]`[アトリビュート](../attribute.md)を付" +"けた`tests`[モジュール](../mod.md)に配置されます。テスト関数には`#[test]`アト" +"リビュートを付与します。" #: src/testing/unit_testing.md:11 msgid "" "Tests fail when something in the test function [panics](../std/panic.md). " "There are some helper [macros](../macros.md):" msgstr "" -"テスト関数内部で[パニック](../std/panic.md)するとテストは失敗となります。" -"次のような[マクロ](../macros.md)が用意されています。" +"テスト関数内部で[パニック](../std/panic.md)するとテストは失敗となります。次の" +"ような[マクロ](../macros.md)が用意されています。" #: src/testing/unit_testing.md:14 msgid "`assert!(expression)` - panics if expression evaluates to `false`." -msgstr "`assert!(expression)` - 式を評価した結果が`false`であればパニックします。" +msgstr "" +"`assert!(expression)` - 式を評価した結果が`false`であればパニックします。" #: src/testing/unit_testing.md:15 msgid "" "`assert_eq!(left, right)` and `assert_ne!(left, right)` - testing left and " "right expressions for equality and inequality respectively." -msgstr "`assert_eq!(left, right)`と`assert_ne!(left, right)` - 左右の式を評価した結果が、それぞれ等しくなること、ならないことをテストします。" +msgstr "" +"`assert_eq!(left, right)`と`assert_ne!(left, right)` - 左右の式を評価した結果" +"が、それぞれ等しくなること、ならないことをテストします。" #: src/testing/unit_testing.md:22 msgid "" @@ -15547,7 +16049,8 @@ msgstr "// 誤った加算をする関数がテストに通らないことを示 msgid "" "// Note this useful idiom: importing names from outer (for mod tests) " "scope.\n" -msgstr "// 外部のスコープから(mod testsに)名前をインポートする便利なイディオム。\n" +msgstr "" +"// 外部のスコープから(mod testsに)名前をインポートする便利なイディオム。\n" #: src/testing/unit_testing.md:42 msgid "" @@ -15571,9 +16074,9 @@ msgid "" "your unit tests can return `Result<()>`, which lets you use `?` in them! " "This can make them much more concise." msgstr "" -"ここまでに例示したユニットテストは返り値の型を持っていませんでしたが、" -"Rust 2018ではユニットテストが`Result<()>`を返し、内部で`?`を使えるようになりました!" -"これにより、ユニットテストをさらに簡潔に記述できます。" +"ここまでに例示したユニットテストは返り値の型を持っていませんでしたが、Rust " +"2018ではユニットテストが`Result<()>`を返し、内部で`?`を使えるようになりまし" +"た!これにより、ユニットテストをさらに簡潔に記述できます。" #: src/testing/unit_testing.md:83 msgid "\"negative floats don't have square roots\"" @@ -15585,8 +16088,9 @@ msgid "" "rust-2018/error-handling-and-panics/question-mark-in-main-and-tests.html) " "for more details." msgstr "" -"詳細は[エディションガイド](https://doc.rust-lang.org/edition-guide/rust-2018/error-handling-and-panics/question-mark-in-main-and-tests.html)" -"を参照してください。" +"詳細は[エディションガイド](https://doc.rust-lang.org/edition-guide/rust-2018/" +"error-handling-and-panics/question-mark-in-main-and-tests.html)を参照してくだ" +"さい。" #: src/testing/unit_testing.md:102 msgid "Testing panics" @@ -15599,9 +16103,10 @@ msgid "" "`expected = ` with the text of the panic message. If your function can panic " "in multiple ways, it helps make sure your test is testing the correct panic." msgstr "" -"ある条件下でパニックすべき関数をテストするには、`#[should_panic]`アトリビュートを使います。" -"このアトリビュートはパニックメッセージをオプションの引数`expected =`で受け取れます。" -"パニックの原因が複数あるときに、想定した原因でパニックが発生したことを確認できます。" +"ある条件下でパニックすべき関数をテストするには、`#[should_panic]`アトリビュー" +"トを使います。このアトリビュートはパニックメッセージをオプションの引数" +"`expected =`で受け取れます。パニックの原因が複数あるときに、想定した原因でパ" +"ニックが発生したことを確認できます。" #: src/testing/unit_testing.md:112 src/testing/doc_testing.md:45 msgid "\"Divide-by-zero error\"" @@ -15628,7 +16133,8 @@ msgstr "`cargo test`にテストの名前を与えると、そのテストだけ msgid "" "To run multiple tests one may specify part of a test name that matches all " "the tests that should be run." -msgstr "テスト名の一部を指定すると、それにマッチするすべてのテストが実行されます。" +msgstr "" +"テスト名の一部を指定すると、それにマッチするすべてのテストが実行されます。" #: src/testing/unit_testing.md:197 msgid "Ignoring tests" @@ -15639,8 +16145,8 @@ msgid "" "Tests can be marked with the `#[ignore]` attribute to exclude some tests. Or " "to run them with command `cargo test -- --ignored`" msgstr "" -"テストを実行から除外するには、`#[ignore]`アトリビュートを使います。" -"また、`cargo test -- --ignored`で、除外したテストのみを実行できます。" +"テストを実行から除外するには、`#[ignore]`アトリビュートを使います。また、" +"`cargo test -- --ignored`で、除外したテストのみを実行できます。" #: src/testing/doc_testing.md:3 msgid "" @@ -15650,10 +16156,10 @@ msgid "" "Rust takes care about correctness, so these code blocks are compiled and " "used as documentation tests." msgstr "" -"Rustのプロジェクトでは、ソースコードに注釈する形でドキュメントを書くのが主流です。" -"ドキュメンテーションコメントの記述は[CommonMark Markdown specification](https://commonmark.org/)" -"で行い、コードブロックも使えます。" -"Rustは正確性を重視しているので、コードブロックもコンパイルされ、テストとして使われます。" +"Rustのプロジェクトでは、ソースコードに注釈する形でドキュメントを書くのが主流" +"です。ドキュメンテーションコメントの記述は[CommonMark Markdown specification]" +"(https://commonmark.org/)で行い、コードブロックも使えます。Rustは正確性を重視" +"しているので、コードブロックもコンパイルされ、テストとして使われます。" #: src/testing/doc_testing.md:10 msgid "" @@ -15671,7 +16177,8 @@ msgid "" msgstr "" "/// 最初の行には関数の機能の短い要約を書きます。\n" "///\n" -"/// 以降で詳細なドキュメンテーションを記述します。コードブロックは三重のバッククォートで始まり、\n" +"/// 以降で詳細なドキュメンテーションを記述します。コードブロックは三重のバッ" +"ククォートで始まり、\n" "/// 暗黙的に`fn main()`と`extern crate <クレート名>`で囲われます。\n" "/// `doccomments`クレートをテストしたいときには、次のように記述します。\n" "///\n" @@ -15729,7 +16236,8 @@ msgid "" "Code blocks in documentation are automatically tested when running the " "regular `cargo test` command:" msgstr "" -"ドキュメンテーションコメント中のコードブロックは、`cargo test`コマンドで自動的にテストされます。" +"ドキュメンテーションコメント中のコードブロックは、`cargo test`コマンドで自動" +"的にテストされます。" #: src/testing/doc_testing.md:71 msgid "Motivation behind documentation tests" @@ -15747,13 +16255,15 @@ msgid "" "try_main() -> Result<(), ErrorType>`, hide it and `unwrap` it in hidden " "`main`. Sounds complicated? Here's an example:" msgstr "" -"ドキュメンテーションテストの主な目的は、実行例を示すことであり、" -"これは最も大切な[ガイドライン](https://rust-lang-nursery.github.io/api-guidelines/documentation.html#examples-use--not-try-not-unwrap-c-question-mark)" -"の一つにもなっています。これにより、ドキュメントの例を実際に動くコードとして使うことができます。" -"しかしながら、`main`が`()`を返すために、`?`を使うとコンパイルに失敗してしまいます。" -"ドキュメンテーションでコードブロックの一部を隠す機能で、この問題に対処できます。" -"つまり、`fn try_main() -> Result<(), ErrorType>`を定義しておきながらそれを隠し、" -"暗黙の`main`の内部で`unwrap`するのです。複雑なので、例を見てみましょう。" +"ドキュメンテーションテストの主な目的は、実行例を示すことであり、これは最も大" +"切な[ガイドライン](https://rust-lang-nursery.github.io/api-guidelines/" +"documentation.html#examples-use--not-try-not-unwrap-c-question-mark)の一つに" +"もなっています。これにより、ドキュメントの例を実際に動くコードとして使うこと" +"ができます。しかしながら、`main`が`()`を返すために、`?`を使うとコンパイルに失" +"敗してしまいます。ドキュメンテーションでコードブロックの一部を隠す機能で、こ" +"の問題に対処できます。つまり、`fn try_main() -> Result<(), ErrorType>`を定義" +"しておきながらそれを隠し、暗黙の`main`の内部で`unwrap`するのです。複雑なの" +"で、例を見てみましょう。" #: src/testing/doc_testing.md:82 msgid "" @@ -15781,7 +16291,8 @@ msgstr "" "/// # Ok(()) // try_mainから値を返します\n" "/// # }\n" "/// # fn main() { // unwrap()を実行します。\n" -"/// # try_main().unwrap(); // try_mainを呼びunwrapすると、エラーの場合にパニックします。\n" +"/// # try_main().unwrap(); // try_mainを呼びunwrapすると、エラーの場合にパ" +"ニックします。\n" "/// # }\n" "/// ```\n" @@ -15813,15 +16324,17 @@ msgid "" "would. Their purpose is to test that many parts of your library work " "correctly together." msgstr "" -"[ユニットテスト](unit_testing.md)は、独立したモジュールを一つずつテストするものであり、" -"テストは小さく、プライベートなコードについてもテストすることができます。" -"統合テストはクレートの外側にあるもので、他の外部のコードと同様に、" -"パブリックなインタフェースだけを使います。" -"統合テストの目的は、ライブラリのそれぞれのモジュールが連携して正しく動作するかどうかテストすることです。" +"[ユニットテスト](unit_testing.md)は、独立したモジュールを一つずつテストするも" +"のであり、テストは小さく、プライベートなコードについてもテストすることができ" +"ます。統合テストはクレートの外側にあるもので、他の外部のコードと同様に、パブ" +"リックなインタフェースだけを使います。統合テストの目的は、ライブラリのそれぞ" +"れのモジュールが連携して正しく動作するかどうかテストすることです。" #: src/testing/integration_testing.md:8 msgid "Cargo looks for integration tests in `tests` directory next to `src`." -msgstr "Cargoは、`src`ディレクトリと並んで配置された`tests`ディレクトリを統合テストとして扱います。" +msgstr "" +"Cargoは、`src`ディレクトリと並んで配置された`tests`ディレクトリを統合テストと" +"して扱います。" #: src/testing/integration_testing.md:10 src/testing/dev_dependencies.md:17 msgid "File `src/lib.rs`:" @@ -15845,9 +16358,9 @@ msgid "" "crate. In order to share some code between integration tests we can make a " "module with public functions, importing and using it within tests." msgstr "" -"`tests`ディレクトリにあるRustのソースファイルは別のクレートとしてコンパイルされます。" -"統合テストの間でコードを共有するには、パブリックな関数をモジュールに入れて、" -"それぞれのテストでインポートして利用する方法があります。" +"`tests`ディレクトリにあるRustのソースファイルは別のクレートとしてコンパイルさ" +"れます。統合テストの間でコードを共有するには、パブリックな関数をモジュールに" +"入れて、それぞれのテストでインポートして利用する方法があります。" #: src/testing/integration_testing.md:54 msgid "File `tests/common/mod.rs`:" @@ -15857,7 +16370,9 @@ msgstr "ファイル`tests/common.rs`:" msgid "" "// some setup code, like creating required files/directories, starting\n" " // servers, etc.\n" -msgstr "// 必要なファイル・ディレクトリの作成やサーバの起動といった準備を行うコードを記述します。\n" +msgstr "" +"// 必要なファイル・ディレクトリの作成やサーバの起動といった準備を行うコードを" +"記述します。\n" #: src/testing/integration_testing.md:63 msgid "File with test: `tests/integration_test.rs`" @@ -15877,8 +16392,8 @@ msgid "" "because the test runner will treat the file as a test crate and try to run " "tests inside it." msgstr "" -"モジュールを`tests/common.rs`に記述することも可能ですが、" -"`tests/common.rs`中のテストも自動的に実行されてしまうため非推奨です。" +"モジュールを`tests/common.rs`に記述することも可能ですが、`tests/common.rs`中" +"のテストも自動的に実行されてしまうため非推奨です。" #: src/testing/dev_dependencies.md:1 msgid "Development dependencies" @@ -15891,9 +16406,10 @@ msgid "" "dependencies]` section. These dependencies are not propagated to other " "packages which depend on this package." msgstr "" -"テスト(あるいは例やベンチマーク)のためだけに、あるクレートに依存しなければならないことがあります。" -"このような依存関係は、`Cargo.toml`の`[dev-dependencies]`セクションに追加します。" -"このセクションに追加した依存関係は、このパッケージに依存するパッケージには適用されません。" +"テスト(あるいは例やベンチマーク)のためだけに、あるクレートに依存しなければ" +"ならないことがあります。このような依存関係は、`Cargo.toml`の`[dev-" +"dependencies]`セクションに追加します。このセクションに追加した依存関係は、こ" +"のパッケージに依存するパッケージには適用されません。" #: src/testing/dev_dependencies.md:8 msgid "" @@ -15902,9 +16418,10 @@ msgid "" "standard `assert_eq!` and `assert_ne!` macros, to provide colorful diff. \n" "File `Cargo.toml`:" msgstr "" -"そのようなクレートの例として、[`pretty_assertions`](https://docs.rs/pretty_assertions/1.0.0/pretty_assertions/index.html)" -"クレートが挙げられます。" -"これは、標準の`assert_eq!`と`assert_ne!`マクロを拡張して、差分をカラフルに表示するものです。 \n" +"そのようなクレートの例として、[`pretty_assertions`](https://docs.rs/" +"pretty_assertions/1.0.0/pretty_assertions/index.html)クレートが挙げられます。" +"これは、標準の`assert_eq!`と`assert_ne!`マクロを拡張して、差分をカラフルに表" +"示するものです。 \n" "ファイル`Cargo.toml`:" #: src/testing/dev_dependencies.md:11 @@ -15932,7 +16449,8 @@ msgid "" "[Cargo](http://doc.crates.io/specifying-dependencies.html) docs on " "specifying dependencies." msgstr "" -"[Cargo](http://doc.crates.io/specifying-dependencies.html) 依存関係の指定について" +"[Cargo](http://doc.crates.io/specifying-dependencies.html) 依存関係の指定につ" +"いて" #: src/unsafe.md:3 msgid "" @@ -15943,12 +16461,12 @@ msgid "" "put in place by the compiler; specifically, there are four primary things " "that unsafe is used for:" msgstr "" -"この章の内容を見る前に、[公式ドキュメント](https://doc.rust-lang.org/book/ch19-01-unsafe-rust.html)" -"から引用した次の文章をお読みください。" -"「コードベース中の、アンセーフな操作をするコードの量は、可能な限り小さく無くてはならない。」" -"この戒めを頭に叩き込んだ上で、さあはじめましょう!" -"Rustにおいて、アンセーフなブロックはコンパイラのチェックをスルーするために使われます。" -"具体的には以下の4つの主要なユースケースがあります。" +"この章の内容を見る前に、[公式ドキュメント](https://doc.rust-lang.org/book/" +"ch19-01-unsafe-rust.html)から引用した次の文章をお読みください。「コードベース" +"中の、アンセーフな操作をするコードの量は、可能な限り小さく無くてはならな" +"い。」この戒めを頭に叩き込んだ上で、さあはじめましょう!Rustにおいて、アン" +"セーフなブロックはコンパイラのチェックをスルーするために使われます。具体的に" +"は以下の4つの主要なユースケースがあります。" #: src/unsafe.md:9 msgid "dereferencing raw pointers" @@ -15958,7 +16476,9 @@ msgstr "生ポインタのデリファレンス" msgid "" "calling functions or methods which are `unsafe` (including calling a " "function over FFI, see [a previous chapter](std_misc/ffi.md) of the book) " -msgstr "安全でない関数やメソッドの呼び出し(FFI経由の関数の呼び出しを含む (詳細は [本書のFFIに関する説明](std_misc/ffi.md) を参照ください))" +msgstr "" +"安全でない関数やメソッドの呼び出し(FFI経由の関数の呼び出しを含む (詳細は [本" +"書のFFIに関する説明](std_misc/ffi.md) を参照ください))" #: src/unsafe.md:12 msgid "accessing or modifying static mutable variables" @@ -15979,9 +16499,9 @@ msgid "" "borrow checker. Dereferencing a raw pointer can only be done through an " "unsafe block." msgstr "" -"生ポインタ`*`と参照`&T`はよく似た機能を持ちますが、" -"後者は必ず有効なデータを指していることが借用チェッカーによって保証されているので、常に安全です。" -"生ポインタのデリファレンスはアンセーフなブロックでしか実行できません。" +"生ポインタ`*`と参照`&T`はよく似た機能を持ちますが、後者は必ず有効なデータを指" +"していることが借用チェッカーによって保証されているので、常に安全です。生ポイ" +"ンタのデリファレンスはアンセーフなブロックでしか実行できません。" #: src/unsafe.md:31 msgid "Calling Unsafe Functions" @@ -15995,10 +16515,10 @@ msgid "" "slice/fn.from_raw_parts.html) which will create a slice given a pointer to " "the first element and a length." msgstr "" -"関数は `unsafe` として宣言できます。" -"これはコンパイラの代わりにプログラマの責任で正しさを保証することを意味します。" -"例として [`std::slice::from_raw_parts`](https://doc.rust-lang.org/std/slice/fn.from_raw_parts.html)" -"があります。この関数は最初の要素へのポインタと長さを指定してスライスを作成します。" +"関数は `unsafe` として宣言できます。これはコンパイラの代わりにプログラマの責" +"任で正しさを保証することを意味します。例として [`std::slice::from_raw_parts`]" +"(https://doc.rust-lang.org/std/slice/fn.from_raw_parts.html)があります。この" +"関数は最初の要素へのポインタと長さを指定してスライスを作成します。" #: src/unsafe.md:54 msgid "" @@ -16008,9 +16528,10 @@ msgid "" "the program's behaviour is undefined and there is no knowing what will " "happen." msgstr "" -"`slice::from_raw_parts` は、次のふたつの仮定に基づいて処理します。" -"ひとつは渡されたポインタが有効なメモリ位置を指していること、もうひとつはそのメモリに格納された値が正しい型であることです。" -"この仮定を満たさない場合、プログラムの動作は不定となり、何が起こるかわかりません。" +"`slice::from_raw_parts` は、次のふたつの仮定に基づいて処理します。ひとつは渡" +"されたポインタが有効なメモリ位置を指していること、もうひとつはそのメモリに格" +"納された値が正しい型であることです。この仮定を満たさない場合、プログラムの動" +"作は不定となり、何が起こるかわかりません。" #: src/unsafe/asm.md:3 msgid "" @@ -16021,16 +16542,19 @@ msgid "" "level hardware primitives, e.g. in kernel code, may also demand this " "functionality." msgstr "" -"Rustは`asm!`マクロによってインラインアセンブリをサポートしています。" -"コンパイラが生成するアセンブリに、手書きのアセンブリを埋め込むことができます。" -"一般的には必要ありませんが、要求されるパフォーマンスやタイミングを達成するために必要な場合があります。" -"カーネルコードのような、低レベルなハードウェアの基本要素にアクセスする場合にも、この機能が必要でしょう。" +"Rustは`asm!`マクロによってインラインアセンブリをサポートしています。コンパイ" +"ラが生成するアセンブリに、手書きのアセンブリを埋め込むことができます。一般的" +"には必要ありませんが、要求されるパフォーマンスやタイミングを達成するために必" +"要な場合があります。カーネルコードのような、低レベルなハードウェアの基本要素" +"にアクセスする場合にも、この機能が必要でしょう。" #: src/unsafe/asm.md:8 msgid "" "**Note**: the examples here are given in x86/x86-64 assembly, but other " "architectures are also supported." -msgstr "**注意**: 以下の例はx86/x86-64アセンブリで書かれていますが、他のアーキテクチャもサポートされています。" +msgstr "" +"**注意**: 以下の例はx86/x86-64アセンブリで書かれていますが、他のアーキテク" +"チャもサポートされています。" #: src/unsafe/asm.md:10 msgid "Inline assembly is currently supported on the following architectures:" @@ -16081,10 +16605,10 @@ msgid "" "break various invariants. The instructions to be inserted are listed in the " "first argument of the `asm!` macro as a string literal." msgstr "" -"これは、コンパイラが生成したアセンブリに、NOP(no operation)命令を挿入します。" -"すべての`asm!`呼び出しは、`unsafe`ブロックの中になければいけません。" -"インラインアセンブリは任意の命令を挿入でき、不変条件を壊してしまうからです。" -"挿入される命令は、文字列リテラルとして`asm!`マクロの第一引数に列挙されます。" +"これは、コンパイラが生成したアセンブリに、NOP(no operation)命令を挿入しま" +"す。すべての`asm!`呼び出しは、`unsafe`ブロックの中になければいけません。イン" +"ラインアセンブリは任意の命令を挿入でき、不変条件を壊してしまうからです。挿入" +"される命令は、文字列リテラルとして`asm!`マクロの第一引数に列挙されます。" #: src/unsafe/asm.md:35 msgid "Inputs and outputs" @@ -16095,8 +16619,8 @@ msgid "" "Now inserting an instruction that does nothing is rather boring. Let us do " "something that actually acts on data:" msgstr "" -"何もしない命令を挿入しても面白くありません。" -"実際にデータを操作してみましょう。" +"何もしない命令を挿入しても面白くありません。実際にデータを操作してみましょ" +"う。" #: src/unsafe/asm.md:46 msgid "\"mov {}, 5\"" @@ -16117,16 +16641,16 @@ msgid "" "into the template and will read the variable from there after the inline " "assembly finishes executing." msgstr "" -"これは`u64`型の変数`x`に`5`の値を書き込んでいます。" -"命令を指定するために利用している文字列リテラルが、実はテンプレート文字列になっています。" -"これはRustの[フォーマット文字列](https://doc.rust-lang.org/std/fmt/#syntax)と同じルールに従います。" -"ですが、テンプレートに挿入される引数は、みなさんがよく知っているものとは少し違っています。" -"まず、変数がインラインアセンブリの入力なのか出力なのかを指定する必要があります。" -"上記の例では出力となっています。" -"`out`と書くことで出力であると宣言しています。" -"また、アセンブリが変数をどの種類のレジスタに格納するかについても指定する必要があります。" -"上の例では、`reg`を指定して任意の汎用レジスタに格納しています。" -"コンパイラはテンプレートに挿入する適切なレジスタを選び、インラインアセンブリの実行終了後、そのレジスタから変数を読みこみます。" +"これは`u64`型の変数`x`に`5`の値を書き込んでいます。命令を指定するために利用し" +"ている文字列リテラルが、実はテンプレート文字列になっています。これはRustの" +"[フォーマット文字列](https://doc.rust-lang.org/std/fmt/#syntax)と同じルールに" +"従います。ですが、テンプレートに挿入される引数は、みなさんがよく知っているも" +"のとは少し違っています。まず、変数がインラインアセンブリの入力なのか出力なの" +"かを指定する必要があります。上記の例では出力となっています。`out`と書くことで" +"出力であると宣言しています。また、アセンブリが変数をどの種類のレジスタに格納" +"するかについても指定する必要があります。上の例では、`reg`を指定して任意の汎用" +"レジスタに格納しています。コンパイラはテンプレートに挿入する適切なレジスタを" +"選び、インラインアセンブリの実行終了後、そのレジスタから変数を読みこみます。" #: src/unsafe/asm.md:65 msgid "Let us see another example that also uses an input:" @@ -16146,8 +16670,9 @@ msgid "" "variable `o`. The particular way this assembly does this is first copying " "the value from `i` to the output, and then adding `5` to it." msgstr "" -"この例では、変数`i`の入力に`5`を加え、その結果を変数`o`に書き込んでいます。" -"このアセンブリ特有のやり方として、はじめに`i`の値を出力にコピーし、それから`5`を加えています。" +"この例では、変数`i`の入力に`5`を加え、その結果を変数`o`に書き込んでいます。こ" +"のアセンブリ特有のやり方として、はじめに`i`の値を出力にコピーし、それから`5`" +"を加えています。" #: src/unsafe/asm.md:89 msgid "The example shows a few things:" @@ -16160,9 +16685,9 @@ msgid "" "joined together with newlines between them. This makes it easy to format " "assembly code." msgstr "" -"まず、`asm!`では複数のテンプレート文字列を引数として利用できます。" -"それぞれの文字列は、改行を挟んで結合されたのと同じように、独立したアセンブリコードとして扱われます。" -"このおかげで、アセンブリコードを容易にフォーマットできます。" +"まず、`asm!`では複数のテンプレート文字列を引数として利用できます。それぞれの" +"文字列は、改行を挟んで結合されたのと同じように、独立したアセンブリコードとし" +"て扱われます。このおかげで、アセンブリコードを容易にフォーマットできます。" #: src/unsafe/asm.md:96 msgid "" @@ -16177,10 +16702,11 @@ msgid "" "using this facility is generally recommended, as it improves readability, " "and allows reordering instructions without changing the argument order." msgstr "" -"そして、他のフォーマット文字列と同じように引数を番号や名前で指定できます。" -"インラインアセンブリのテンプレートでは、引数が2回以上利用されることが多いため、これは特に便利です。" -"より複雑なインラインアセンブリを書く場合、この機能を使うのが推奨されます。" -"可読性が向上し、引数の順序を変えることなく命令を並べ替えることができるからです。" +"そして、他のフォーマット文字列と同じように引数を番号や名前で指定できます。イ" +"ンラインアセンブリのテンプレートでは、引数が2回以上利用されることが多いため、" +"これは特に便利です。より複雑なインラインアセンブリを書く場合、この機能を使う" +"のが推奨されます。可読性が向上し、引数の順序を変えることなく命令を並べ替える" +"ことができるからです。" #: src/unsafe/asm.md:103 msgid "We can further refine the above example to avoid the `mov` instruction:" @@ -16192,14 +16718,17 @@ msgid "" "and output. This is different from specifying an input and output separately " "in that it is guaranteed to assign both to the same register." msgstr "" -"`inout`で入力でもあり出力でもある引数を指定しています。" -"こうすることで、入力と出力を個別に指定する場合と違って、入出力が同じレジスタに割り当てられることが保証されます。" +"`inout`で入力でもあり出力でもある引数を指定しています。こうすることで、入力と" +"出力を個別に指定する場合と違って、入出力が同じレジスタに割り当てられることが" +"保証されます。" #: src/unsafe/asm.md:120 msgid "" "It is also possible to specify different variables for the input and output " "parts of an `inout` operand:" -msgstr "`inout`のオペランドとして、入力と出力それぞれに異なる変数を指定することも可能です。" +msgstr "" +"`inout`のオペランドとして、入力と出力それぞれに異なる変数を指定することも可能" +"です。" #: src/unsafe/asm.md:135 msgid "Late output operands" @@ -16216,19 +16745,21 @@ msgid "" "output that is written only after all inputs have been consumed. There is " "also an `inlateout` variant of this specifier." msgstr "" -"Rustコンパイラはオペランドの割り当てに保守的です。" -"`out`はいつでも書き込めるので、他の引数とは場所を共有できません。" -"しかし、最適なパフォーマンスを保証するためには、できるだけ少ないレジスタを使うことが重要です。" -"そうすることで、インラインアセンブリブロックの前後でレジスタを保存したり再読み込みしたりする必要がありません。" -"これを達成するために、Rustは`lateout`指定子を提供します。" -"全ての入力が消費された後でのみ書き込まれる出力に利用できます。" -"この指定子には`inlateout`という変化形もあります。" +"Rustコンパイラはオペランドの割り当てに保守的です。`out`はいつでも書き込めるの" +"で、他の引数とは場所を共有できません。しかし、最適なパフォーマンスを保証する" +"ためには、できるだけ少ないレジスタを使うことが重要です。そうすることで、イン" +"ラインアセンブリブロックの前後でレジスタを保存したり再読み込みしたりする必要" +"がありません。これを達成するために、Rustは`lateout`指定子を提供します。全ての" +"入力が消費された後でのみ書き込まれる出力に利用できます。この指定子には" +"`inlateout`という変化形もあります。" #: src/unsafe/asm.md:145 msgid "" "Here is an example where `inlateout` _cannot_ be used in `release` mode or " "other optimized cases:" -msgstr "以下は、`release`モードやその他の最適化された場合に、`inlateout`を利用 *できない* 例です。" +msgstr "" +"以下は、`release`モードやその他の最適化された場合に、`inlateout`を利用 *でき" +"ない* 例です。" #: src/unsafe/asm.md:156 src/unsafe/asm.md:180 src/unsafe/asm.md:463 msgid "\"add {0}, {1}\"" @@ -16256,22 +16787,27 @@ msgid "" "overwrite the initial load from variable `c`. This is in contrast to how " "using `inout(reg) a` ensures a separate register is allocated for `a`. " msgstr "" -"というのも、最適化されている場合、コンパイラは`b`と`c`が同じ値だと知っているので、" -"`b`と`c`の入力に同じレジスタを割り当てる場合があります。" -"もし`inlateout`が使われていたら、`a`と`c`に同じレジスタが割り当てられ、最初の`add`命令によって`c`の値が上書きされるでしょう。" -"`inout(reg) a`の使用により`a`に対する独立したレジスタ割り当てが保証されるのとは対照的です。" +"というのも、最適化されている場合、コンパイラは`b`と`c`が同じ値だと知っている" +"ので、`b`と`c`の入力に同じレジスタを割り当てる場合があります。もし`inlateout`" +"が使われていたら、`a`と`c`に同じレジスタが割り当てられ、最初の`add`命令によっ" +"て`c`の値が上書きされるでしょう。`inout(reg) a`の使用により`a`に対する独立し" +"たレジスタ割り当てが保証されるのとは対照的です。" #: src/unsafe/asm.md:171 msgid "" "However, the following example can use `inlateout` since the output is only " "modified after all input registers have been read:" -msgstr "しかし、次の例では、全ての入力レジスタが読み込まれた後でのみ出力が変更されるので、`inlateout`を利用できます。" +msgstr "" +"しかし、次の例では、全ての入力レジスタが読み込まれた後でのみ出力が変更される" +"ので、`inlateout`を利用できます。" #: src/unsafe/asm.md:186 msgid "" "As you can see, this assembly fragment will still work correctly if `a` and " "`b` are assigned to the same register." -msgstr "このアセンブリコードは、`a`と`b`が同じレジスタに割り当てられても、正しく動作します。" +msgstr "" +"このアセンブリコードは、`a`と`b`が同じレジスタに割り当てられても、正しく動作" +"します。" #: src/unsafe/asm.md:188 msgid "Explicit register operands" @@ -16286,10 +16822,11 @@ msgid "" "registers `eax`, `ebx`, `ecx`, `edx`, `ebp`, `esi`, and `edi` among others " "can be addressed by their name." msgstr "" -"いくつかの命令では、オペランドが特定のレジスタにある必要があります。" -"したがって、Rustのインラインアセンブリでは、より具体的な制約指定子を提供しています。" -"`reg`は一般的にどのアーキテクチャでも利用可能ですが、明示的レジスタはアーキテクチャに強く依存しています。" -"たとえば、x86の汎用レジスタである`eax`、`ebx`、`ecx`、`edx`、`ebp`、`esi`、`edi`などは、その名前で指定できます。" +"いくつかの命令では、オペランドが特定のレジスタにある必要があります。したがっ" +"て、Rustのインラインアセンブリでは、より具体的な制約指定子を提供しています。" +"`reg`は一般的にどのアーキテクチャでも利用可能ですが、明示的レジスタはアーキテ" +"クチャに強く依存しています。たとえば、x86の汎用レジスタである`eax`、`ebx`、" +"`ecx`、`edx`、`ebp`、`esi`、`edi`などは、その名前で指定できます。" #: src/unsafe/asm.md:200 msgid "\"out 0x64, eax\"" @@ -16306,8 +16843,8 @@ msgid "" "`eax` (and its sub registers) as operand we had to use the `eax` constraint " "specifier." msgstr "" -"この例では、`out`命令を呼び出して、`cmd`変数の中身を`0x64`ポートに出力しています。" -"`out`命令は`eax`とそのサブレジスタのみをオペランドとして受け取るため、" +"この例では、`out`命令を呼び出して、`cmd`変数の中身を`0x64`ポートに出力してい" +"ます。`out`命令は`eax`とそのサブレジスタのみをオペランドとして受け取るため、" "`eax`の制約指定子を使わなければなりません。" #: src/unsafe/asm.md:207 @@ -16317,9 +16854,10 @@ msgid "" "register name directly instead. Also, they must appear at the end of the " "operand list after all other operand types." msgstr "" -"**注意**: 他のオペランドタイプと異なり、明示的なレジスタオペランドはテンプレート文字列中で利用できません。" -"`{}`を使えないので、レジスタの名前を直接書く必要があります。" -"また、オペランドのリストの中で他のオペランドタイプの一番最後に置かれなくてはなりません。" +"**注意**: 他のオペランドタイプと異なり、明示的なレジスタオペランドはテンプ" +"レート文字列中で利用できません。`{}`を使えないので、レジスタの名前を直接書く" +"必要があります。また、オペランドのリストの中で他のオペランドタイプの一番最後" +"に置かれなくてはなりません。" #: src/unsafe/asm.md:209 msgid "Consider this example which uses the x86 `mul` instruction:" @@ -16352,11 +16890,12 @@ msgid "" "result are stored in `rax` from which we fill the variable `lo`. The higher " "64 bits are stored in `rdx` from which we fill the variable `hi`." msgstr "" -"`mul`命令を使って2つの64ビットの入力を128ビットの結果に出力しています。" -"唯一の明示的なオペランドはレジスタで、変数`a`から入力します。" -"2つ目のオペランドは暗黙的であり、`rax`レジスタである必要があります。変数`b`から`rax`レジスタに入力します。" -"計算結果の下位64ビットは`rax`レジスタに保存され、そこから変数`lo`に出力されます。" -"上位64ビットは`rdx`レジスタに保存され、そこから変数`hi`に出力されます。" +"`mul`命令を使って2つの64ビットの入力を128ビットの結果に出力しています。唯一の" +"明示的なオペランドはレジスタで、変数`a`から入力します。2つ目のオペランドは暗" +"黙的であり、`rax`レジスタである必要があります。変数`b`から`rax`レジスタに入力" +"します。計算結果の下位64ビットは`rax`レジスタに保存され、そこから変数`lo`に出" +"力されます。上位64ビットは`rdx`レジスタに保存され、そこから変数`hi`に出力され" +"ます。" #: src/unsafe/asm.md:241 msgid "Clobbered registers" @@ -16371,13 +16910,12 @@ msgid "" "We need to tell the compiler about this since it may need to save and " "restore this state around the inline assembly block." msgstr "" -"多くの場合、インラインアセンブリは出力として必要のない状態を変更することがあります。" -"これは普通、アセンブリでスクラッチレジスタを利用する必要があったり、" -"私たちがこれ以上必要としていない状態を命令が変更したりするためです。" -"この状態を一般的に\"クロバー\"(訳注:上書き)と呼びます。" -"私たちはコンパイラにこのことを伝える必要があります。" -"なぜならコンパイラは、インラインアセンブリブロックの前後で、" -"この状態を保存して復元しなくてはならない可能性があるからです。" +"多くの場合、インラインアセンブリは出力として必要のない状態を変更することがあ" +"ります。これは普通、アセンブリでスクラッチレジスタを利用する必要があったり、" +"私たちがこれ以上必要としていない状態を命令が変更したりするためです。この状態" +"を一般的に\"クロバー\"(訳注:上書き)と呼びます。私たちはコンパイラにこのこ" +"とを伝える必要があります。なぜならコンパイラは、インラインアセンブリブロック" +"の前後で、この状態を保存して復元しなくてはならない可能性があるからです。" #: src/unsafe/asm.md:253 msgid "// three entries of four bytes each\n" @@ -16393,9 +16931,11 @@ msgid "" "register instead.\n" msgstr "" "// 文字列はasciiとしてebx, edx, ecxの順に保存されています。\n" -" // ebxは予約されているので、アセンブリはebxの値を維持する必要があります。\n" +" // ebxは予約されているので、アセンブリはebxの値を維持する必要がありま" +"す。\n" " // 従ってメインのアセンブリの前後でプッシュおよびポップを行います。\n" -" // (以下は64ビットプロセッサの64ビットモードの場合。32ビットプロセッサはebxを利用します。)\n" +" // (以下は64ビットプロセッサの64ビットモードの場合。32ビットプロセッサは" +"ebxを利用します。)\n" #: src/unsafe/asm.md:263 msgid "\"push rbx\"" @@ -16433,7 +16973,8 @@ msgid "" msgstr "" "// いくつかのアセンブリ命令を追加してRustのコードを単純化するために\n" " // 値を格納する配列へのポインタを利用します。\n" -" // しかし、`out(\"ecx\") val`のような明示的なレジスタの出力とは違い、\n" +" // しかし、`out(\"ecx\") val`のような明示的なレジスタの出力とは違" +"い、\n" " // アセンブリの動作をより明示的にします。\n" " // *ポインタそのもの* は後ろに書かれていても入力にすぎません。\n" @@ -16468,9 +17009,9 @@ msgid "" "`cpuid` argument and `ebx`, `edx`, and `ecx` with the CPU manufacturer ID as " "ASCII bytes in that order." msgstr "" -"上の例では、`cpuid`命令を使い、CPUベンタIDを読み込んでいます。" -"この命令は`eax`にサポートされている最大の`cpuid`引数を書き込み、" -"`ebx`、`edx`、`ecx`の順にCPUベンダIDをASCIIコードとして書き込みます。" +"上の例では、`cpuid`命令を使い、CPUベンタIDを読み込んでいます。この命令は`eax`" +"にサポートされている最大の`cpuid`引数を書き込み、`ebx`、`edx`、`ecx`の順にCPU" +"ベンダIDをASCIIコードとして書き込みます。" #: src/unsafe/asm.md:294 msgid "" @@ -16480,10 +17021,10 @@ msgid "" "output but with `_` instead of a variable name, which indicates that the " "output value is to be discarded." msgstr "" -"`eax`は読み込まれることはありません。" -"しかし、コンパイラがアセンブリ以前にこれらのレジスタにあった値を保存できるように、" -"レジスタが変更されたことをコンパイラに伝える必要があります。" -"そのために、変数名の代わりに`_`を用いて出力を宣言し、出力の値が破棄されるということを示しています。" +"`eax`は読み込まれることはありません。しかし、コンパイラがアセンブリ以前にこれ" +"らのレジスタにあった値を保存できるように、レジスタが変更されたことをコンパイ" +"ラに伝える必要があります。そのために、変数名の代わりに`_`を用いて出力を宣言" +"し、出力の値が破棄されるということを示しています。" #: src/unsafe/asm.md:296 msgid "" @@ -16495,12 +17036,13 @@ msgid "" "makes `reg` operands dangerous when using reserved registers as we could " "unknowingly corrupt our input or output because they share the same register." msgstr "" -"このコードは`ebx`がLLVMによって予約されたレジスタであるという制約を回避しています。" -"LLVMは、自身がレジスタを完全にコントロールし、" -"アセンブリブロックを抜ける前に元の状態を復元しなくてはならないと考えています。" -"そのため、コンパイラが`in(reg)`のような汎用レジスタクラスを満たすために使用する場合 **を除いて** `ebx`を入力や出力として利用できません。" -"つまり、予約されたレジスタを利用する場合に、`reg`オペランドは危険なのです。" -"入力と出力が同じレジスタを共有しているので、知らないうちに入力や出力を破壊してしまうかもしれません。" +"このコードは`ebx`がLLVMによって予約されたレジスタであるという制約を回避してい" +"ます。LLVMは、自身がレジスタを完全にコントロールし、アセンブリブロックを抜け" +"る前に元の状態を復元しなくてはならないと考えています。そのため、コンパイラが" +"`in(reg)`のような汎用レジスタクラスを満たすために使用する場合 **を除いて** " +"`ebx`を入力や出力として利用できません。つまり、予約されたレジスタを利用する場" +"合に、`reg`オペランドは危険なのです。入力と出力が同じレジスタを共有しているの" +"で、知らないうちに入力や出力を破壊してしまうかもしれません。" #: src/unsafe/asm.md:298 msgid "" @@ -16511,18 +17053,19 @@ msgid "" "register is saved. On 32 bit targets the code would instead use `ebx` in the " "`push`/`pop`." msgstr "" -"これを回避するために、`rdi`を用いて出力の配列へのポインタを保管し、`push`で`ebx`を保存し、" -"アセンブリブロック内で`ebx`から読み込んで配列に書き込み、`pop`で`ebx`を元の状態に戻しています。" -"`push`と`pop`は完全な64ビットの`rbx`レジスタを使って、レジスタ全体を確実に保存しています。" -"32ビットの場合、`push`と`pop`において`ebx`がかわりに利用されるでしょう。" +"これを回避するために、`rdi`を用いて出力の配列へのポインタを保管し、`push`で" +"`ebx`を保存し、アセンブリブロック内で`ebx`から読み込んで配列に書き込み、`pop`" +"で`ebx`を元の状態に戻しています。`push`と`pop`は完全な64ビットの`rbx`レジスタ" +"を使って、レジスタ全体を確実に保存しています。32ビットの場合、`push`と`pop`に" +"おいて`ebx`がかわりに利用されるでしょう。" #: src/unsafe/asm.md:300 msgid "" "This can also be used with a general register class to obtain a scratch " "register for use inside the asm code:" msgstr "" -"アセンブリコード内部で利用するスクラッチレジスタを獲得するために、" -"汎用レジスタクラスとともに使用することもできます。" +"アセンブリコード内部で利用するスクラッチレジスタを獲得するために、汎用レジス" +"タクラスとともに使用することもできます。" #: src/unsafe/asm.md:305 msgid "// Multiply x by 6 using shifts and adds\n" @@ -16551,19 +17094,21 @@ msgstr "シンボル・オペランドとABIクロバー" #: src/unsafe/asm.md:324 msgid "" "By default, `asm!` assumes that any register not specified as an output will " -"have its contents preserved by the assembly code. The [`clobber_abi`](../../" -"reference/inline-assembly.html#abi-clobbers) argument to `asm!` tells the " -"compiler to automatically insert the necessary clobber operands according to " -"the given calling convention ABI: any register which is not fully preserved " -"in that ABI will be treated as clobbered. Multiple `clobber_abi` arguments " -"may be provided and all clobbers from all specified ABIs will be inserted." -msgstr "" -"デフォルトでは、`asm!`は、出力として指定されていないレジスタはアセンブリコードによって中身が維持される、と考えます。" -"`asm!`に渡される[`clobber_abi`](https://doc.rust-lang.org/stable/reference/inline-assembly.html#abi-clobbers)" -"引数は、与えられた呼び出し規約のABIに従って、" -"必要なクロバーオペランドを自動的に挿入するようコンパイラに伝えます。" -"そのABIで完全に保存されていないレジスタは、クロバーとして扱われます。" -"複数の `clobber_abi` 引数を指定すると、指定されたすべてのABIのクロバーが挿入されます。" +"have its contents preserved by the assembly code. The [`clobber_abi`]" +"(https://doc.rust-lang.org/stable/reference/inline-assembly.html#abi-" +"clobbers) argument to `asm!` tells the compiler to automatically insert the " +"necessary clobber operands according to the given calling convention ABI: " +"any register which is not fully preserved in that ABI will be treated as " +"clobbered. Multiple `clobber_abi` arguments may be provided and all " +"clobbers from all specified ABIs will be inserted." +msgstr "" +"デフォルトでは、`asm!`は、出力として指定されていないレジスタはアセンブリコー" +"ドによって中身が維持される、と考えます。`asm!`に渡される[`clobber_abi`]" +"(https://doc.rust-lang.org/stable/reference/inline-assembly.html#abi-" +"clobbers)引数は、与えられた呼び出し規約のABIに従って、必要なクロバーオペラン" +"ドを自動的に挿入するようコンパイラに伝えます。そのABIで完全に保存されていない" +"レジスタは、クロバーとして扱われます。複数の `clobber_abi` 引数を指定すると、" +"指定されたすべてのABIのクロバーが挿入されます。" #: src/unsafe/asm.md:332 src/unsafe/asm.md:350 msgid "\"C\"" @@ -16593,7 +17138,8 @@ msgstr "// 戻り値はraxにあります。\n" msgid "" "// Mark all registers which are not preserved by the \"C\" calling\n" " // convention as clobbered.\n" -msgstr "// \"C\"の呼び出し規約で保存されていないすべてのレジスタをクロバーに指定。\n" +msgstr "" +"// \"C\"の呼び出し規約で保存されていないすべてのレジスタをクロバーに指定。\n" #: src/unsafe/asm.md:358 msgid "Register template modifiers" @@ -16607,23 +17153,26 @@ msgid "" "each typically being a \"view\" over a subset of the register (e.g. the low " "32 bits of a 64-bit register)." msgstr "" -"テンプレート文字列に挿入されるレジスタの名前のフォーマット方法について、細かい制御が必要な場合があります。" -"アーキテクチャのアセンブリ言語が、同じレジスタに別名を持っている場合です。" -"典型的な例としては、レジスタの部分集合に対する\"ビュー\"があります(例:64ビットレジスタの下位32ビット)。" +"テンプレート文字列に挿入されるレジスタの名前のフォーマット方法について、細か" +"い制御が必要な場合があります。アーキテクチャのアセンブリ言語が、同じレジスタ" +"に別名を持っている場合です。典型的な例としては、レジスタの部分集合に対する" +"\"ビュー\"があります(例:64ビットレジスタの下位32ビット)。" #: src/unsafe/asm.md:362 msgid "" "By default the compiler will always choose the name that refers to the full " "register size (e.g. `rax` on x86-64, `eax` on x86, etc)." msgstr "" -"デフォルトでは、コンパイラは常に完全なレジスタサイズの名前を選択します" -"(例:x86-64では`rax`、x86では`eax`、など)。" +"デフォルトでは、コンパイラは常に完全なレジスタサイズの名前を選択します(例:" +"x86-64では`rax`、x86では`eax`、など)。" #: src/unsafe/asm.md:364 msgid "" "This default can be overridden by using modifiers on the template string " "operands, just like you would with format strings:" -msgstr "この挙動は、フォーマット文字列と同じように、テンプレート文字列のオペランドに修飾子を利用することで上書きできます。" +msgstr "" +"この挙動は、フォーマット文字列と同じように、テンプレート文字列のオペランドに" +"修飾子を利用することで上書きできます。" #: src/unsafe/asm.md:373 msgid "\"mov {0:h}, {0:l}\"" @@ -16635,8 +17184,9 @@ msgid "" "register allocator to the 4 legacy x86 registers (`ax`, `bx`, `cx`, `dx`) of " "which the first two bytes can be addressed independently." msgstr "" -"この例では、`reg_abcd`レジスタクラスを用いて、レジスタアロケータを4つのレガシーなx86レジスタ" -"(`ax`, `bx`, `cx`, `dx`)に制限しています。このうち最初の2バイトは独立して指定できます。" +"この例では、`reg_abcd`レジスタクラスを用いて、レジスタアロケータを4つのレガ" +"シーなx86レジスタ(`ax`, `bx`, `cx`, `dx`)に制限しています。このうち最初の2" +"バイトは独立して指定できます。" #: src/unsafe/asm.md:382 msgid "" @@ -16647,8 +17197,9 @@ msgid "" "copies the low byte of the value into the high byte." msgstr "" "レジスタアロケータが`x`を`ax`レジスタに割り当てることにしたと仮定しましょう。" -"`h`修飾子はそのレジスタの上位バイトのレジスタ名を出力し、`l`修飾子は下位バイトのレジスタ名を出力します。" -"したがって、このアセンブリコードは`mov ah, al`に展開され、値の下位バイトを上位バイトにコピーします。" +"`h`修飾子はそのレジスタの上位バイトのレジスタ名を出力し、`l`修飾子は下位バイ" +"トのレジスタ名を出力します。したがって、このアセンブリコードは`mov ah, al`に" +"展開され、値の下位バイトを上位バイトにコピーします。" #: src/unsafe/asm.md:385 msgid "" @@ -16656,8 +17207,8 @@ msgid "" "use template modifiers, the compiler will emit a warning and suggest the " "correct modifier to use." msgstr "" -"より小さなデータ型(例:`u16`)をオペランドに利用し、テンプレート修飾子を使い忘れた場合、" -"コンパイラは警告を出力し、正しい修飾子を提案してくれます。" +"より小さなデータ型(例:`u16`)をオペランドに利用し、テンプレート修飾子を使い" +"忘れた場合、コンパイラは警告を出力し、正しい修飾子を提案してくれます。" #: src/unsafe/asm.md:387 msgid "Memory address operands" @@ -16671,10 +17222,11 @@ msgid "" "assembly syntax, you should wrap inputs/outputs in `[]` to indicate they are " "memory operands:" msgstr "" -"アセンブリ命令はオペランドがメモリアドレスやメモリロケーション経由で渡される必要なこともあります。" -"そのときは手動で、ターゲットのアーキテクチャによって指定されたメモリアドレスのシンタックスを利用しなくてはなりません。" -"例えば、Intelのアセンブリシンタックスを使うx86/x86_64の場合、入出力を`[]`で囲んで、" -"メモリオペランドであることを示さなくてはなりません。" +"アセンブリ命令はオペランドがメモリアドレスやメモリロケーション経由で渡される" +"必要なこともあります。そのときは手動で、ターゲットのアーキテクチャによって指" +"定されたメモリアドレスのシンタックスを利用しなくてはなりません。例えば、Intel" +"のアセンブリシンタックスを使うx86/x86_64の場合、入出力を`[]`で囲んで、メモリ" +"オペランドであることを示さなくてはなりません。" #: src/unsafe/asm.md:399 msgid "\"fldcw [{}]\"" @@ -16690,15 +17242,17 @@ msgid "" "or linker error or may cause other strange behavior. Reuse of a named label " "can happen in a variety of ways including:" msgstr "" -"名前つきラベルの再利用は、ローカルかそうでないかに関わらず、" -"アセンブラやリンカのエラーを引き起こしたり、変な挙動の原因となります。" -"名前つきラベルの再利用は以下のようなケースがあります。" +"名前つきラベルの再利用は、ローカルかそうでないかに関わらず、アセンブラやリン" +"カのエラーを引き起こしたり、変な挙動の原因となります。名前つきラベルの再利用" +"は以下のようなケースがあります。" #: src/unsafe/asm.md:409 msgid "" "explicitly: using a label more than once in one `asm!` block, or multiple " "times across blocks." -msgstr "明示的再利用:同じラベルを1つの`asm!`ブロック中で、または複数のブロック中で2回以上利用する場合です。" +msgstr "" +"明示的再利用:同じラベルを1つの`asm!`ブロック中で、または複数のブロック中で2" +"回以上利用する場合です。" #: src/unsafe/asm.md:410 msgid "" @@ -16706,16 +17260,18 @@ msgid "" "copies of an `asm!` block, for example when the function containing it is " "inlined in multiple places." msgstr "" -"インライン化による暗黙の再利用:コンパイラは`asm!`ブロックの複数のコピーをインスタンス化する場合があります。" -"例えば、`asm!`ブロックを含む関数が複数箇所でインライン化される場合です。" +"インライン化による暗黙の再利用:コンパイラは`asm!`ブロックの複数のコピーをイ" +"ンスタンス化する場合があります。例えば、`asm!`ブロックを含む関数が複数箇所で" +"インライン化される場合です。" #: src/unsafe/asm.md:411 msgid "" "implicitly via LTO: LTO can cause code from _other crates_ to be placed in " "the same codegen unit, and so could bring in arbitrary labels." msgstr "" -"LTO(訳注:Link Time Optimizationの略)による暗黙の再利用:" -"LTOは *他のクレート* のコードを同じコード生成単位に配置するため、同じ名前のラベルを持ち込む場合があります。" +"LTO(訳注:Link Time Optimizationの略)による暗黙の再利用:LTOは *他のクレー" +"ト* のコードを同じコード生成単位に配置するため、同じ名前のラベルを持ち込む場" +"合があります。" #: src/unsafe/asm.md:413 msgid "" @@ -16724,9 +17280,10 @@ msgid "" "Labels) inside inline assembly code. Defining symbols in assembly code may " "lead to assembler and/or linker errors due to duplicate symbol definitions." msgstr "" -"そのため、インラインアセンブリコードの中では、GNUアセンブラの **数値型**" -"[ローカルラベル](https://sourceware.org/binutils/docs/as/Symbol-Names.html#Local-Labels)のみ使用してください。" -"アセンブリコード内でシンボルを定義すると、シンボル定義の重複により、アセンブラやリンカのエラーが発生する可能性があります。" +"そのため、インラインアセンブリコードの中では、GNUアセンブラの **数値型**[ロー" +"カルラベル](https://sourceware.org/binutils/docs/as/Symbol-Names.html#Local-" +"Labels)のみ使用してください。アセンブリコード内でシンボルを定義すると、シンボ" +"ル定義の重複により、アセンブラやリンカのエラーが発生する可能性があります。" #: src/unsafe/asm.md:415 msgid "" @@ -16737,11 +17294,12 @@ msgid "" "will avoid any ambiguity, but that affects the syntax of the _entire_ `asm!` " "block. (See [Options](#options), below, for more on `options`.)" msgstr "" -"さらに、x86でデフォルトのIntel構文を使用する場合、[LLVMのバグ](https://bugs.llvm.org/show_bug.cgi?id=36144)によって、" -"`0`、`11`、`101010`といった`0`と`1`だけで構成されたラベルは、" -"バイナリ値として解釈されてしまうため、使用してはいけません。" -"`options(att_syntax)`を使うと曖昧さを避けられますが、`asm!`ブロック _全体_ の構文に影響します。" -"(`options`については、後述の[オプション](#オプション)を参照してください。)" +"さらに、x86でデフォルトのIntel構文を使用する場合、[LLVMのバグ](https://bugs." +"llvm.org/show_bug.cgi?id=36144)によって、`0`、`11`、`101010`といった`0`と`1`" +"だけで構成されたラベルは、バイナリ値として解釈されてしまうため、使用してはい" +"けません。`options(att_syntax)`を使うと曖昧さを避けられますが、`asm!`ブロッ" +"ク _全体_ の構文に影響します。(`options`については、後述の[オプション](#options" +")を参照してください。)" #: src/unsafe/asm.md:424 msgid "\"mov {0}, 10\"" @@ -16775,7 +17333,9 @@ msgstr "\"add {0}, 2\"" msgid "" "This will decrement the `{0}` register value from 10 to 3, then add 2 and " "store it in `a`." -msgstr "このコードは、`{0}`のレジスタの値を10から3にデクリメントし、2を加え、`a`にその値を保存します。" +msgstr "" +"このコードは、`{0}`のレジスタの値を10から3にデクリメントし、2を加え、`a`にそ" +"の値を保存します。" #: src/unsafe/asm.md:441 msgid "This example shows a few things:" @@ -16785,7 +17345,8 @@ msgstr "この例は、以下のことを示しています。" msgid "" "First, that the same number can be used as a label multiple times in the " "same inline block." -msgstr "まず、ラベルとして同じ数字を複数回、同じインラインブロックで利用できます。" +msgstr "" +"まず、ラベルとして同じ数字を複数回、同じインラインブロックで利用できます。" #: src/unsafe/asm.md:444 msgid "" @@ -16794,9 +17355,10 @@ msgid "" "should be added to the numeric label. It will then refer to the nearest " "label defined by this number in this direction." msgstr "" -"つぎに、数字のラベルが参照として(例えば、命令のオペランドに)利用された場合、" -"\"b\"(\"後方\")や\"f\"(\"前方\")の接尾辞が数字のラベルに追加されなくてはなりません。" -"そうすることで、この数字の指定された方向の最も近いラベルを参照できます。" +"つぎに、数字のラベルが参照として(例えば、命令のオペランドに)利用された場" +"合、\"b\"(\"後方\")や\"f\"(\"前方\")の接尾辞が数字のラベルに追加されなく" +"てはなりません。そうすることで、この数字の指定された方向の最も近いラベルを参" +"照できます。" #: src/unsafe/asm.md:449 msgid "Options" @@ -16810,9 +17372,11 @@ msgid "" "desirable to give the compiler more information about what the assembly code " "is actually doing so that it can optimize better." msgstr "" -"デフォルトでは、インラインアセンブリブロックは、カスタム呼び出し規約をもつ外部のFFI関数呼び出しと同じように扱われます:" -"メモリを読み込んだり書き込んだり、観測可能な副作用を持っていたりするかもしれません。" -"しかし、多くの場合、アセンブリコードが実際に何をするかという情報を多く与えて、より最適化できる方が望ましいでしょう。" +"デフォルトでは、インラインアセンブリブロックは、カスタム呼び出し規約をもつ外" +"部のFFI関数呼び出しと同じように扱われます:メモリを読み込んだり書き込んだり、" +"観測可能な副作用を持っていたりするかもしれません。しかし、多くの場合、アセン" +"ブリコードが実際に何をするかという情報を多く与えて、より最適化できる方が望ま" +"しいでしょう。" #: src/unsafe/asm.md:453 msgid "Let's take our previous example of an `add` instruction:" @@ -16823,8 +17387,8 @@ msgid "" "Options can be provided as an optional final argument to the `asm!` macro. " "We specified three options here:" msgstr "" -"オプションは`asm!`マクロの最後の任意引数として渡されます。" -"ここでは3つのオプションを利用しました:" +"オプションは`asm!`マクロの最後の任意引数として渡されます。ここでは3つのオプ" +"ションを利用しました:" #: src/unsafe/asm.md:473 msgid "" @@ -16832,9 +17396,10 @@ msgid "" "output depends only on its inputs. This allows the compiler optimizer to " "call the inline asm fewer times or even eliminate it entirely." msgstr "" -"`pure`は、アセンブリコードが観測可能な副作用を持っておらず、出力は入力のみに依存することを意味します。" -"これにより、コンパイラオプティマイザはインラインアセンブリの呼び出し回数を減らしたり、" -"インラインアセンブリを完全に削除したりできます。" +"`pure`は、アセンブリコードが観測可能な副作用を持っておらず、出力は入力のみに" +"依存することを意味します。これにより、コンパイラオプティマイザはインラインア" +"センブリの呼び出し回数を減らしたり、インラインアセンブリを完全に削除したりで" +"きます。" #: src/unsafe/asm.md:474 msgid "" @@ -16843,9 +17408,10 @@ msgid "" "address that is accessible to it (e.g. through a pointer passed as an " "operand, or a global)." msgstr "" -"`nomem`は、アセンブリコードがメモリの読み書きをしないことを意味します。" -"デフォルトでは、インラインアセンブリはアクセス可能なメモリアドレス" -"(例えばオペランドとして渡されたポインタや、グローバルなど)の読み書きを行うとコンパイラは仮定しています。" +"`nomem`は、アセンブリコードがメモリの読み書きをしないことを意味します。デフォ" +"ルトでは、インラインアセンブリはアクセス可能なメモリアドレス(例えばオペラン" +"ドとして渡されたポインタや、グローバルなど)の読み書きを行うとコンパイラは仮" +"定しています。" #: src/unsafe/asm.md:475 msgid "" @@ -16853,25 +17419,25 @@ msgid "" "This allows the compiler to use optimizations such as the stack red zone on " "x86-64 to avoid stack pointer adjustments." msgstr "" -"`nostack`は、アセンブリコードがスタックにデータをプッシュしないことを意味します。" -"これにより、コンパイラはx86-64のスタックレッドゾーンなどの最適化を利用し、" -"スタックポインタの調整を避けることができます。" +"`nostack`は、アセンブリコードがスタックにデータをプッシュしないことを意味しま" +"す。これにより、コンパイラはx86-64のスタックレッドゾーンなどの最適化を利用" +"し、スタックポインタの調整を避けることができます。" #: src/unsafe/asm.md:477 msgid "" "These allow the compiler to better optimize code using `asm!`, for example " "by eliminating pure `asm!` blocks whose outputs are not needed." msgstr "" -"これにより、コンパイラは、出力が全く必要とされていない純粋な`asm!`ブロックを削除するなどして、" -"`asm!`を使ったコードをより最適化できます。" +"これにより、コンパイラは、出力が全く必要とされていない純粋な`asm!`ブロックを" +"削除するなどして、`asm!`を使ったコードをより最適化できます。" #: src/unsafe/asm.md:479 msgid "" "See the [reference](https://doc.rust-lang.org/stable/reference/inline-" "assembly.html) for the full list of available options and their effects." msgstr "" -"利用可能なオプションとその効果の一覧は[リファレンス](https://doc.rust-lang.org/stable/reference/inline-assembly.html)" -"を参照してください。" +"利用可能なオプションとその効果の一覧は[リファレンス](https://doc.rust-lang." +"org/stable/reference/inline-assembly.html)を参照してください。" #: src/compatibility.md:3 msgid "" @@ -16879,8 +17445,8 @@ msgid "" "compatibility issues can arise, despite efforts to ensure forwards-" "compatibility wherever possible." msgstr "" -"Rust言語は急速に進化しており、可能な限り前方互換性を確保する努力にも関わらず、" -"特定の互換性の問題が生じることがあります。" +"Rust言語は急速に進化しており、可能な限り前方互換性を確保する努力にも関わら" +"ず、特定の互換性の問題が生じることがあります。" #: src/compatibility.md:7 msgid "[Raw identifiers](compatibility/raw_identifiers.md)" @@ -16897,9 +17463,11 @@ msgid "" "as a keyword introduced in a newer edition." msgstr "" "Rustは多くのプログラミング言語と同様に、「キーワード」の概念を持っています。" -"これらの識別子は言語にとって何かしらの意味を持ちますので、変数名や関数名、その他の場所で使用することはできません。" -"生識別子は、通常は許されない状況でキーワードを使用することを可能にします。" -"これは、新しいキーワードを導入したRustと、古いエディションのRustを使用したライブラリが同じ名前の変数や関数を持つ場合に特に便利です。" +"これらの識別子は言語にとって何かしらの意味を持ちますので、変数名や関数名、そ" +"の他の場所で使用することはできません。生識別子は、通常は許されない状況でキー" +"ワードを使用することを可能にします。これは、新しいキーワードを導入したRust" +"と、古いエディションのRustを使用したライブラリが同じ名前の変数や関数を持つ場" +"合に特に便利です。" #: src/compatibility/raw_identifiers.md:11 msgid "" @@ -16908,8 +17476,10 @@ msgid "" "feature in the 2018 edition, so without raw identifiers, we would have no " "way to name the function." msgstr "" -"例えば、2015年エディションのRustでコンパイルされたクレート`foo`が`try`という名前の関数をエクスポートしているとします。" -"このキーワードは2018年エディションで新機能として予約されていますので、生識別子がなければ、この関数を名付ける方法がありません。" +"例えば、2015年エディションのRustでコンパイルされたクレート`foo`が`try`という" +"名前の関数をエクスポートしているとします。このキーワードは2018年エディション" +"で新機能として予約されていますので、生識別子がなければ、この関数を名付ける方" +"法がありません。" #: src/compatibility/raw_identifiers.md:24 msgid "You'll get this error:" @@ -16921,76 +17491,79 @@ msgstr "これは生識別子を使って書くことができます:" #: src/meta.md:3 msgid "" -"Some topics aren't exactly relevant to how you program but provide you " +"Some topics aren't exactly relevant to how you program runs but provide you " "tooling or infrastructure support which just makes things better for " "everyone. These topics include:" msgstr "" -"この章では、プログラミングそれ自体に関係はないけれども、" -"色々と人々の役に立つ機能やインフラについて説明していきます。例えば:" +"この章では、プログラミングそれ自体に関係はないけれども、色々と人々の役に立つ" +"機能やインフラについて説明していきます。例えば:" #: src/meta.md:7 msgid "" "[Documentation](meta/doc.md): Generate library documentation for users via " "the included `rustdoc`." -msgstr "[ドキュメンテーション](meta/doc.md): Rust付属コマンド`rustdoc`を用いて、ライブラリのドキュメントを生成します。" +msgstr "" +"[ドキュメンテーション](meta/doc.md): Rust付属コマンド`rustdoc`を用いて、ライ" +"ブラリのドキュメントを生成します。" #: src/meta.md:9 msgid "" "[Playground](meta/playground.md): Integrate the Rust Playground in your " "documentation." -msgstr "[プレイグラウンド](meta/playground.md): あなたのドキュメンテーションにRust Playgroundを組み込めます。" +msgstr "" +"[プレイグラウンド](meta/playground.md): あなたのドキュメンテーションにRust " +"Playgroundを組み込めます。" #: src/meta/doc.md:3 -msgid "Use `cargo doc` to build documentation in `target/doc`." +msgid "" +"Use `cargo doc` to build documentation in `target/doc`, `cargo doc --open` " +"will automatically open it in your web browser." msgstr "" -#: src/meta/doc.md:5 +#: src/meta/doc.md:6 msgid "" "Use `cargo test` to run all tests (including documentation tests), and " "`cargo test --doc` to only run documentation tests." msgstr "" -#: src/meta/doc.md:8 +#: src/meta/doc.md:9 msgid "" "These commands will appropriately invoke `rustdoc` (and `rustc`) as required." msgstr "" -#: src/meta/doc.md:10 +#: src/meta/doc.md:11 msgid "Doc comments" msgstr "ドキュメンテーションコメント" -#: src/meta/doc.md:12 +#: src/meta/doc.md:13 msgid "" "Doc comments are very useful for big projects that require documentation. " "When running `rustdoc`, these are the comments that get compiled into " "documentation. They are denoted by a `///`, and support [Markdown](https://" "en.wikipedia.org/wiki/Markdown)." msgstr "" -"ドキュメンテーションコメントとは`rustdoc`を使用した際にドキュメントにコンパイルされるコメントのことです。" -"`///`によって普通のコメントと区別され、ここでは[Markdown](https://en.wikipedia.org/wiki/Markdown)を使用することができます。" +"ドキュメンテーションコメントとは`rustdoc`を使用した際にドキュメントにコンパイ" +"ルされるコメントのことです。`///`によって普通のコメントと区別され、ここでは" +"[Markdown](https://en.wikipedia.org/wiki/Markdown)を使用することができます。" "ドキュメンテーションコメントは大規模なプロジェクトの際に非常に有用です。" -#: src/meta/doc.md:17 +#: src/meta/doc.md:18 msgid "\"doc\"" msgstr "\"doc\"" -#: src/meta/doc.md:18 +#: src/meta/doc.md:19 msgid "/// A human being is represented here\n" msgstr "/// あらゆる人物はここに代表されます。\n" -#: src/meta/doc.md:21 +#: src/meta/doc.md:22 msgid "/// A person must have a name, no matter how much Juliet may hate it\n" msgstr "" "/// ジュリエットがどんなに名前というものを嫌っていようと、\n" " /// 人物には名前が必要です。\n" -#: src/meta/doc.md:26 +#: src/meta/doc.md:27 msgid "" -"/// Returns a person with the name given them\n" -" ///\n" -" /// # Arguments\n" -" ///\n" -" /// * `name` - A string slice that holds the name of the person\n" +"/// Creates a person with the given name.\n" " ///\n" " /// # Examples\n" " ///\n" @@ -17003,10 +17576,6 @@ msgid "" msgstr "" "/// 与えられた名前を持つpersonを返します。\n" " ///\n" -" /// # Arguments\n" -" ///\n" -" /// * `name` - `person`の名前を表す文字列のスライス\n" -" ///\n" " /// # Examples\n" " ///\n" " /// ```\n" @@ -17017,7 +17586,7 @@ msgstr "" " /// let person = Person::new(\"name\");\n" " /// ```\n" -#: src/meta/doc.md:46 +#: src/meta/doc.md:43 msgid "" "/// Gives a friendly hello!\n" " ///\n" @@ -17029,21 +17598,21 @@ msgstr "" " /// このメソッドを呼び出した`Person`に対して\n" " /// \"Hello, [name](Person::name)\"と話しかけます。\n" -#: src/meta/doc.md:50 +#: src/meta/doc.md:47 msgid "\"Hello, {}!\"" msgstr "\"Hello, {}!\"" -#: src/meta/doc.md:55 +#: src/meta/doc.md:52 msgid "\"John\"" msgstr "\"John\"" -#: src/meta/doc.md:61 +#: src/meta/doc.md:58 msgid "" "To run the tests, first build the code as a library, then tell `rustdoc` " "where to find the library so it can link it into each doctest program:" msgstr "" -#: src/meta/doc.md:64 +#: src/meta/doc.md:61 msgid "" "```shell\n" "$ rustc doc.rs --crate-type lib\n" @@ -17055,93 +17624,93 @@ msgstr "" "$ rustdoc --test --extern doc=\"libdoc.rlib\" doc.rs\n" "```" -#: src/meta/doc.md:69 +#: src/meta/doc.md:66 msgid "Doc attributes" msgstr "" -#: src/meta/doc.md:71 +#: src/meta/doc.md:68 msgid "" "Below are a few examples of the most common `#[doc]` attributes used with " "`rustdoc`." msgstr "" -#: src/meta/doc.md:74 +#: src/meta/doc.md:71 msgid "`inline`" msgstr "`inline`" -#: src/meta/doc.md:76 +#: src/meta/doc.md:73 msgid "Used to inline docs, instead of linking out to separate page." msgstr "" -#: src/meta/doc.md:81 +#: src/meta/doc.md:78 msgid "/// bar docs\n" msgstr "" -#: src/meta/doc.md:84 +#: src/meta/doc.md:81 msgid "/// the docs for Bar\n" msgstr "" -#: src/meta/doc.md:89 +#: src/meta/doc.md:86 msgid "`no_inline`" msgstr "`no_inline`" -#: src/meta/doc.md:91 +#: src/meta/doc.md:88 msgid "Used to prevent linking out to separate page or anywhere." msgstr "" -#: src/meta/doc.md:94 +#: src/meta/doc.md:91 msgid "// Example from libcore/prelude\n" msgstr "" -#: src/meta/doc.md:99 +#: src/meta/doc.md:96 msgid "`hidden`" msgstr "`hidden`" -#: src/meta/doc.md:101 +#: src/meta/doc.md:98 msgid "Using this tells `rustdoc` not to include this in documentation:" msgstr "" -#: src/meta/doc.md:104 +#: src/meta/doc.md:101 msgid "// Example from the futures-rs library\n" msgstr "" -#: src/meta/doc.md:109 +#: src/meta/doc.md:106 msgid "" "For documentation, `rustdoc` is widely used by the community. It's what is " "used to generate the [std library docs](https://doc.rust-lang.org/std/)." msgstr "" -#: src/meta/doc.md:114 +#: src/meta/doc.md:111 msgid "" "[The Rust Book: Making Useful Documentation Comments](https://doc.rust-lang." "org/book/ch14-02-publishing-to-crates-io.html#making-useful-documentation-" "comments)" msgstr "" -#: src/meta/doc.md:115 +#: src/meta/doc.md:112 msgid "[The rustdoc Book](https://doc.rust-lang.org/rustdoc/index.html)" msgstr "" -#: src/meta/doc.md:116 +#: src/meta/doc.md:113 msgid "" "[The Reference: Doc comments](https://doc.rust-lang.org/stable/reference/" "comments.html#doc-comments)" msgstr "" -#: src/meta/doc.md:117 +#: src/meta/doc.md:114 msgid "" "[RFC 1574: API Documentation Conventions](https://rust-lang.github.io/" "rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-" "conventions-text)" msgstr "" -#: src/meta/doc.md:118 +#: src/meta/doc.md:115 msgid "" "[RFC 1946: Relative links to other items from doc comments (intra-rustdoc " "links)](https://rust-lang.github.io/rfcs/1946-intra-rustdoc-links.html)" msgstr "" -#: src/meta/doc.md:119 +#: src/meta/doc.md:116 msgid "" "[Is there any documentation style guide for comments? (reddit)](https://www." "reddit.com/r/rust/comments/ahb50s/" @@ -17153,7 +17722,8 @@ msgid "" "The [Rust Playground](https://play.rust-lang.org/) is a way to experiment " "with Rust code through a web interface." msgstr "" -"[Rust Playground](https://play.rust-lang.org/)では、RustのコードをWebのインターフェースを通じて実験できます。" +"[Rust Playground](https://play.rust-lang.org/)では、RustのコードをWebのイン" +"ターフェースを通じて実験できます。" #: src/meta/playground.md:6 msgid "Using it with `mdbook`" @@ -17164,7 +17734,8 @@ msgid "" "In [`mdbook`](https://github.com/rust-lang/mdBook), you can make code " "examples playable and editable." msgstr "" -"[`mdbook`](https://github.com/rust-lang/mdBook)では、コード例を実行・編集可能にできます。" +"[`mdbook`](https://github.com/rust-lang/mdBook)では、コード例を実行・編集可能" +"にできます。" #: src/meta/playground.md:16 msgid "" @@ -17172,15 +17743,17 @@ msgid "" "tweak it. The key here is the adding of the word `editable` to your " "codefence block separated by a comma." msgstr "" -"これにより、読者はあなたのコード例を実行するだけでなく、変更することもできます。" -"`editable`という単語をカンマで区切って、あなたのコードブロックに追加するのがキーです。" +"これにより、読者はあなたのコード例を実行するだけでなく、変更することもできま" +"す。`editable`という単語をカンマで区切って、あなたのコードブロックに追加する" +"のがキーです。" #: src/meta/playground.md:26 msgid "" "Additionally, you can add `ignore` if you want `mdbook` to skip your code " "when it builds and tests." msgstr "" -"加えて、`mdbook`がビルドやテストを実行するときに、あなたのコードをスキップさせたい場合は、`ignore`を追加できます。" +"加えて、`mdbook`がビルドやテストを実行するときに、あなたのコードをスキップさ" +"せたい場合は、`ignore`を追加できます。" #: src/meta/playground.md:35 msgid "Using it with docs" @@ -17194,10 +17767,12 @@ msgid "" "`#[doc]` attribute called [`html_playground_url`](https://doc.rust-lang.org/" "rustdoc/write-documentation/the-doc-attribute.html#html_playground_url)." msgstr "" -"[Rustの公式ドキュメント](https://doc.rust-lang.org/core/)には、「実行(Run)」ボタンがある場合があります。" -"クリックすると、新しいタブでRust Playgroundが開き、コード例が表示されます。" -"この機能は、#[doc]アトリビュートの[`html_playground_url`](https://doc.rust-lang.org/rustdoc/write-documentation/the-doc-attribute.html#html_playground_url)" -"の値で有効化できます。" +"[Rustの公式ドキュメント](https://doc.rust-lang.org/core/)には、「実行(Run)」" +"ボタンがある場合があります。クリックすると、新しいタブでRust Playgroundが開" +"き、コード例が表示されます。この機能は、#[doc]アトリビュートの" +"[`html_playground_url`](https://doc.rust-lang.org/rustdoc/write-" +"documentation/the-doc-attribute.html#html_playground_url)の値で有効化できま" +"す。" #: src/meta/playground.md:42 msgid "" @@ -17229,3 +17804,27 @@ msgstr "" msgid "" "[The rustdoc Book](https://doc.rust-lang.org/rustdoc/what-is-rustdoc.html)" msgstr "" + +#~ msgid "\"Base 16 (hexadecimal): {:X}\"" +#~ msgstr "\"Base 16 (hexadecimal): {:X}\"" + +#~ msgid "// 10F2C\n" +#~ msgstr "// 10F2C\n" + +#~ msgid "\"The rich have lots of money!\"" +#~ msgstr "\"The rich have lots of money!\"" + +#~ msgid "\"The poor have no money...\"" +#~ msgstr "\"The poor have no money...\"" + +#~ msgid "\"Civilians work!\"" +#~ msgstr "\"Civilians work!\"" + +#~ msgid "\"Soldiers fight!\"" +#~ msgstr "\"Soldiers fight!\"" + +#~ msgid "\"Old enough {}\"" +#~ msgstr "\"Old enough {}\"" + +#~ msgid "\"the quick brown fox jumped over the lazy dog\\n\"" +#~ msgstr "\"the quick brown fox jumped over the lazy dog\\n\""