From 80facb3f1812c26a6e613ba806dfd8ff35163462 Mon Sep 17 00:00:00 2001 From: dalance Date: Mon, 17 Jun 2024 09:58:57 +0900 Subject: [PATCH] Update ja.po and mdbook-i18n-helpers --- .github/workflows/rbe.yml | 2 +- po/ja.po | 360 ++++++++++++++++++++------------------ 2 files changed, 195 insertions(+), 167 deletions(-) diff --git a/.github/workflows/rbe.yml b/.github/workflows/rbe.yml index d8097c3c7a..afec6fda56 100644 --- a/.github/workflows/rbe.yml +++ b/.github/workflows/rbe.yml @@ -32,7 +32,7 @@ jobs: - name: Install mdbook-i18n-helpers run: | - cargo install mdbook-i18n-helpers --locked --version 0.3.3 + cargo install mdbook-i18n-helpers --locked --version 0.3.4 - name: Report versions run: | diff --git a/po/ja.po b/po/ja.po index 221d6d95fb..8dffcc3cc9 100644 --- a/po/ja.po +++ b/po/ja.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: Rust By Example\n" -"POT-Creation-Date: 2024-05-19T14:23:57+09:00\n" +"POT-Creation-Date: 2024-06-14T21:07:36+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" @@ -779,7 +779,7 @@ msgstr "Rust by Example" msgid "" "[Rust](https://www.rust-lang.org/) is a modern systems programming language " "focusing on safety, speed, and concurrency. It accomplishes these goals by " -"being memory safe without using garbage collection." +"being memory safe without using garbage collection." msgstr "" "[Rust](https://www.rust-lang.org/) は安全性、速度、並列性にフォーカスした現代" "的なシステムプログラミング用のプログラミング言語です。ガベージコレクション無" @@ -791,8 +791,8 @@ msgid "" "various Rust concepts and standard libraries. To get even more out of these " "examples, don't forget to [install Rust locally](https://www.rust-lang.org/" "tools/install) and check out the [official docs](https://doc.rust-lang.org/" -"std/). Additionally for the curious, you can also [check out the source " -"code for this site](https://github.com/rust-lang/rust-by-example)." +"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の" "様々なコンセプトと標準ライブラリを紹介していきます。この例をより活用するため" @@ -2777,12 +2777,12 @@ msgstr "" #: src/custom_types/structs.md:60 msgid "" -"// `bottom_right.y` will be the same as `point.y` because we used that " -"field\n" -" // from `point`\n" +"// `bottom_right.y` will be the same as `another_point.y` because we used " +"that field\n" +" // from `another_point`\n" msgstr "" -"// `bottom_right.y`の値は`point.y`と同一ですが、\n" -" // これは`point`のフィールドの値を用いて生成したためです。\n" +"// `bottom_right.y`の値は`another_point.y`と同一ですが、\n" +" // これは`another_point`のフィールドの値を用いて生成したためです。\n" #: src/custom_types/structs.md:62 msgid "\"second point: ({}, {})\"" @@ -2845,8 +2845,7 @@ msgid "" "md)" msgstr "" "[アトリビュート](../attribute.md), [生識別子](../compatibility/" -"raw_identifiers.md), [デストラクト](../flow_control/match/" -"destructuring.md)" +"raw_identifiers.md), [デストラクト](../flow_control/match/destructuring.md)" #: src/custom_types/enum.md:3 msgid "" @@ -3030,8 +3029,8 @@ 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) " -msgstr "[`match`](../../flow_control/match.md), [`use`](../../mod/use.md) " +msgid "[`match`](../../flow_control/match.md) and [`use`](../../mod/use.md)" +msgstr "[`match`](../../flow_control/match.md), [`use`](../../mod/use.md)" #: src/custom_types/enum/c_like.md:3 msgid "`enum` can also be used as C-like enums." @@ -3344,7 +3343,7 @@ msgstr "コンパイラはミュータビリティに関するエラーの詳細 #: src/variable_bindings/scope.md:3 msgid "" "Variable bindings have a scope, and are constrained to live in a _block_. A " -"block is a collection of statements enclosed by braces `{}`. " +"block is a collection of statements enclosed by braces `{}`." msgstr "" "変数はスコープを持つため、 **ブロック** の中に閉じ込められています。ブロック" "とは`{}`で囲まれた領域のことです。" @@ -3457,7 +3456,7 @@ 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:" +"data can't be modified until the immutable binding goes out of scope:" msgstr "" "データを同じ名前のイミュータブルな変数に束縛しなおすと、データは*凍結*されま" "す。*凍結*したデータは、イミュータブルな束縛がスコープ外になるまで変更できま" @@ -3698,7 +3697,7 @@ msgstr "// -100.0 as u8 は 156\n" #: src/types/literals.md:3 msgid "" "Numeric literals can be type annotated by adding the type as a suffix. As an " -"example, to specify that the literal `42` should have the type `i32`, write " +"example, to specify that the literal `42` should have the type `i32`, write " "`42i32`." msgstr "" "数値型リテラルはサフィックスにより型を指定することが可能です。例えば、`42`と" @@ -3772,7 +3771,7 @@ msgstr "" msgid "" "The type inference engine is pretty smart. It does more than looking at the " "type of the value expression during an initialization. It also looks at how " -"the variable is used afterwards to infer its type. Here's an advanced " +"the variable is used afterwards to infer its type. Here's an advanced " "example of type inference:" msgstr "" "Rustの型推論エンジンはなかなか賢くできています。初期化の際に評価値の型を" @@ -3924,7 +3923,8 @@ msgstr "例えば、`str`から`String`への型変換は簡単です。" msgid "We can do similar for defining a conversion for our own type." msgstr "自作の型に対しても、型変換を定義すれば同じように行えます。" -#: src/conversion/from_into.md:39 src/conversion/from_into.md:71 +#: src/conversion/from_into.md:39 src/conversion/from_into.md:68 +#: src/conversion/from_into.md:98 msgid "\"My number is {:?}\"" msgstr "\"My number is {:?}\"" @@ -3935,28 +3935,48 @@ msgstr "`Into`" #: src/conversion/from_into.md:45 msgid "" "The [`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) trait is " -"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." +"simply the reciprocal of the `From` trait. It defines how to convert a type " +"into another type." msgstr "" "[`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html)トレイトは、単" -"に`From`トレイトの逆の働きをします。もし自作の型に`From`トレイトが実装されて" -"いたら、`Into`は必要に応じてそれを呼び出します。" +"に`From`トレイトの逆の働きをし、ある型を他の型に変換する方法を定義します。" -#: src/conversion/from_into.md:49 +#: src/conversion/from_into.md:48 msgid "" -"Using the `Into` trait will typically require specification of the type to " -"convert into as the compiler is unable to determine this most of the time. " -"However this is a small trade-off considering we get the functionality for " -"free." +"Calling `into()` typically requires us to specify the result type as the " +"compiler is unable to determine this most of the time." msgstr "" -"`Into`トレイトを使用すると、ほとんどの場合、コンパイラが型を決定することがで" -"きないため、変換する型を指定する必要があります。しかし、この機能を無料で得ら" -"れることを考えれば、これは小さなトレードオフです。" +"`into()` の呼び出し時にはほとんどの場合戻り値の型をコンパイラが決定できません。" +"そのため戻り値の型は明示的に指定する必要があります。" -#: src/conversion/from_into.md:69 +#: src/conversion/from_into.md:66 msgid "// Try removing the type annotation\n" msgstr "// ここの型アノテーションを消してみましょう。\n" +#: src/conversion/from_into.md:72 +msgid "`From` and `Into` are interchangable" +msgstr "`From`と`Into` は交換可能" + +#: src/conversion/from_into.md:74 +msgid "" +"`From` and `Into` are designed to be complementary. We do not need to " +"provide an implementation for both traits. If you have implemented the " +"`From` trait for your type, `Into` will call it when necessary. Note, " +"however, that the converse is not true: implementing `Into` for your type " +"will not automatically provide it with an implementation of `From`." +msgstr "" +"`From` と `Into` は相補的にデザインされているので両方のトレイトを実装する必要はありません。" +"`From` トレイトを実装すれば、 `Into` は必要なときに呼ばれます。" +"ただし、逆は真ではない点に注意してください。 `Into` が実装されていても、 `From` が自動的に提供されるわけではありません。" + +#: src/conversion/from_into.md:86 +msgid "// Define `From`\n" +msgstr "// Define `From`\n" + +#: src/conversion/from_into.md:96 +msgid "// use `Into`\n" +msgstr "// use `Into`\n" + #: src/conversion/try_from_try_into.md:3 msgid "" "Similar to [`From` and `Into`](from_into.html), [`TryFrom`](https://doc.rust-" @@ -6339,8 +6359,8 @@ msgstr "" #: src/fn/closures/closure_examples/iter_find.md:3 msgid "" "`Iterator::find` is a function which iterates over an iterator and searches " -"for the first value which satisfies some condition. If none of the values " -"satisfy the condition, it returns `None`. Its signature:" +"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`を返します。型シグネチャは以下のようになりま" @@ -6865,9 +6885,9 @@ msgstr "" #: src/mod/struct_visibility.md:3 msgid "" -"Structs have an extra level of visibility with their fields. The visibility " -"defaults to private, and can be overridden with the `pub` modifier. This " -"visibility only matters when a struct is accessed from outside the module " +"Structs have an extra level of visibility with their fields. The visibility " +"defaults to private, and can be overridden with the `pub` modifier. This " +"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 "" "構造体はそれ自身に加え、フィールドごとにもパブリック・プライベートを設定する" @@ -7195,7 +7215,7 @@ msgstr "" #: src/crates/using_lib.md:3 msgid "" "To link a crate to this new library you may use `rustc`'s `--extern` flag. " -"All of its items will then be imported under a module named the same as the " +"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`フラグを利" @@ -7470,7 +7490,7 @@ msgstr "" #: src/cargo/test.md:23 msgid "" -"Each file in `tests` is a separate [integration test](https://doc.rust-lang." +"Each file in `tests` is a separate [integration test](https://doc.rust-lang." "org/book/ch11-03-test-organization.html#integration-tests), i.e. a test that " "is meant to test your library as if it were being called from a dependent " "crate." @@ -7482,8 +7502,8 @@ msgstr "" #: src/cargo/test.md:28 msgid "" "The [Testing](../testing.md) chapter elaborates on the three different " -"testing styles: [Unit](../testing/unit_testing.md), [Doc](../testing/" -"doc_testing.md), and [Integration](../testing/integration_testing.md). " +"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)、[ドキュメンテーションテスト]" @@ -7565,7 +7585,7 @@ msgstr "" #: src/cargo/test.md:73 msgid "" "One word of caution: Cargo may run multiple tests concurrently, so make sure " -"that they don't race with each other. " +"that they don't race with each other." msgstr "" "注意:Cargoは複数のテストを並列で実行することがありますので、それらが互いに競" "合しないようにしてください。" @@ -7997,9 +8017,9 @@ msgstr "`cfg`フラグがある場合:" msgid "" "_Generics_ is the topic of generalizing types and functionalities to broader " "cases. This is extremely useful for reducing code duplication in many ways, " -"but can call for rather involved syntax. Namely, being generic requires " -"taking great care to specify over which types a generic type is actually " -"considered valid. The simplest and most common use of generics is for type " +"but can call for rather involved syntax. Namely, being generic requires " +"taking great care to specify over which types a generic type is actually " +"considered valid. The simplest and most common use of generics is for type " "parameters." msgstr "" "ジェネリクスとは、型と関数の機能をより汎用的に使えるようにするための機能で" @@ -8014,8 +8034,8 @@ msgid "" "upper [camel case](https://en.wikipedia.org/wiki/CamelCase): ``. \"Generic type parameters\" are typically represented as ``. In Rust, " "\"generic\" also describes anything that accepts one or more generic type " -"parameters ``. Any type specified as a generic type parameter is " -"generic, and everything else is concrete (non-generic)." +"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)(``)が使われます。ジェネリッ" @@ -8034,9 +8054,9 @@ msgstr "" #: src/generics.md:23 msgid "" -"Because `T` has been specified as a generic type parameter using ``, it " +"Because `T` has been specified as a generic type parameter using ``, it " "is considered generic when used here as `(arg: T)`. This is the case even if " -"`T` has previously been defined as a `struct`." +"`T` has previously been defined as a `struct`." msgstr "" "となります。`T`はジェネリックな型パラメータに指定されているので、この場所で" "`(arg: T)`のように使用するとジェネリック型として扱われます。これは`T`という構" @@ -8123,10 +8143,10 @@ msgstr "" #: src/generics/gen_fn.md:6 msgid "" -"Using generic functions sometimes requires explicitly specifying type " +"Using generic functions sometimes requires explicitly specifying type " "parameters. This may be the case if the function is called where the return " -"type is generic, or if the compiler doesn't have enough information to " -"infer the necessary type parameters." +"type is generic, or if the compiler doesn't have enough information to infer " +"the necessary type parameters." msgstr "" "ジェネリック関数を使用する際、型パラメータを明示する必要がある場合がありま" "す。返り値がジェネリック型である場合や、コンパイラが型パラメータを推論するの" @@ -8388,7 +8408,7 @@ msgstr "" #: src/generics/bounds.md:26 msgid "" "Another effect of bounding is that generic instances are allowed to access " -"the [methods](../fn/methods.md) of traits specified in the bounds. For " +"the [methods](../fn/methods.md) of traits specified in the bounds. For " "example:" msgstr "" "境界のもう一つの効果は、ジェネリック型のインスタンスが、境界条件となるトレイ" @@ -8552,8 +8572,8 @@ msgstr "[`std::fmt`](../hello/print.md), [トレイト](../trait.md)" #: src/generics/where.md:3 msgid "" "A bound can also be expressed using a `where` clause immediately before the " -"opening `{`, rather than at the type's first mention. Additionally, `where` " -"clauses can apply bounds to arbitrary types, rather than just to type " +"opening `{`, rather than at the type's first mention. Additionally, `where` " +"clauses can apply bounds to arbitrary types, rather than just to type " "parameters." msgstr "" "トレイト境界は、`{`の直前に`where`句を導入することでも設けることができます。" @@ -8574,9 +8594,8 @@ msgstr "// `where`を用いてジェネリック境界を設けます。\n" #: src/generics/where.md:21 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:" +"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`句を使わずに" "書くことはできません。" @@ -8666,7 +8685,7 @@ msgstr "[構造体](../custom_types/structs.md)" msgid "" "\"Associated Items\" refers to a set of rules pertaining to [`item`](https://" "doc.rust-lang.org/reference/items.html)s of various types. It is an " -"extension to `trait` generics, and allows `trait`s to internally define new " +"extension to `trait` generics, and allows `trait`s to internally define new " "items." msgstr "" "関連要素とは複数の型の[要素](https://doc.rust-lang.org/reference/items.html)" @@ -8675,7 +8694,7 @@ msgstr "" #: src/generics/assoc_items.md:7 msgid "" -"One such item is called an _associated type_, providing simpler usage " +"One such item is called an _associated type_, providing simpler usage " "patterns when the `trait` is generic over its container type." msgstr "" "そのように定義する要素の一つに **関連型** があります。これにより、ジェネリッ" @@ -8700,8 +8719,8 @@ msgstr "" #: src/generics/assoc_items/the_problem.md:6 msgid "" -"In the example below, the `Contains` `trait` allows the use of the generic " -"types `A` and `B`. The trait is then implemented for the `Container` type, " +"In the example below, the `Contains` `trait` allows the use of the generic " +"types `A` and `B`. The trait is then implemented for the `Container` type, " "specifying `i32` for `A` and `B` so that it can be used with `fn " "difference()`." msgstr "" @@ -8712,9 +8731,9 @@ msgstr "" #: src/generics/assoc_items/the_problem.md:10 msgid "" "Because `Contains` is generic, we are forced to explicitly state _all_ of " -"the generic types for `fn difference()`. In practice, we want a way to " -"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." +"the generic types for `fn difference()`. In practice, we want a way to " +"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`は **引数** であ" @@ -8788,7 +8807,7 @@ msgstr "[構造体](../../custom_types/structs.md), [トレイト](../../trait.m #: src/generics/assoc_items/types.md:3 msgid "" -"The use of \"Associated types\" improves the overall readability of code by " +"The use of \"Associated types\" improves the overall readability of code by " "moving inner types locally into a trait as _output_ types. Syntax for the " "`trait` definition is as follows:" msgstr "" @@ -9074,8 +9093,8 @@ msgstr "" #: src/scope.md:3 msgid "" "Scopes play an important part in ownership, borrowing, and lifetimes. That " -"is, they indicate to the compiler when borrows are valid, when resources " -"can be freed, and when variables are created or destroyed." +"is, they indicate to the compiler when borrows are valid, when resources can " +"be freed, and when variables are created or destroyed." msgstr "" "所有権、借用、ライフタイムといったRustに特有の概念において、変数のスコープは" "重要な役割を果たします。すなわち、スコープの存在によってコンパイラは借用は可" @@ -9193,9 +9212,9 @@ msgstr "[Box](../std/box.md)" #: src/scope/move.md:3 msgid "" -"Because variables are in charge of freeing their own resources, **resources " -"can only have one owner**. This prevents resources from being freed more " -"than once. Note that not all variables own resources (e.g. [references](../" +"Because variables are in charge of freeing their own resources, **resources " +"can only have one owner**. This prevents resources from being freed more " +"than once. Note that not all variables own resources (e.g. [references](../" "flow_control/match/destructuring/destructure_pointers.md))." msgstr "" "変数には自身の保持する資源を開放する責任があるため、**資源は一度に一つの所有" @@ -9207,7 +9226,7 @@ msgstr "" #: src/scope/move.md:8 msgid "" "When doing assignments (`let x = y`) or passing function arguments by value " -"(`foo(x)`), the _ownership_ of the resources is transferred. In Rust-speak, " +"(`foo(x)`), the _ownership_ of the resources is transferred. In Rust-speak, " "this is known as a _move_." msgstr "" "変数を代入する(`let x = y`)際や、関数に引数を値渡しする(`foo(x)`)際は、資" @@ -9339,11 +9358,11 @@ msgstr "\"mutable_box now contains {}\"" #: src/scope/move/partial_move.md:3 msgid "" "Within the [destructuring](../../flow_control/match/destructuring.md) of a " -"single variable, both `by-move` and `by-reference` pattern bindings can be " -"used at the same time. Doing this will result in a _partial move_ of the " -"variable, which means that parts of the variable will be moved while other " -"parts stay. In such a case, the parent variable cannot be used afterwards " -"as a whole, however the parts that are only referenced (and not moved) can " +"single variable, both `by-move` and `by-reference` pattern bindings can be " +"used at the same time. Doing this will result in a _partial move_ of the " +"variable, which means that parts of the variable will be moved while other " +"parts stay. In such a case, the parent variable cannot be used afterwards as " +"a whole, however the parts that are only referenced (and not moved) can " "still be used." msgstr "" "1つの変数の [デストラクト](../../flow_control/match/destructuring.md) の中" @@ -9387,12 +9406,11 @@ msgstr "\"The person's age from person struct is {}\"" #: src/scope/move/partial_move.md:38 msgid "" -"(In this example, we store the `age` variable on the heap to illustrate the " -"partial move: deleting `ref` in the above code would give an error as the " -"ownership of `person.age` would be moved to the variable `age`. If `Person." -"age` were stored on the stack, `ref` would not be required as the " -"definition of `age` would copy the data from `person.age` without moving " -"it.)" +"(In this example, we store the `age` variable on the heap to illustrate the " +"partial move: deleting `ref` in the above code would give an error as the " +"ownership of `person.age` would be moved to the variable `age`. If `Person." +"age` were stored on the stack, `ref` would not be required as the definition " +"of `age` would copy the data from `person.age` without moving it.)" msgstr "" "この例では、`age`変数をヒープ上に保持し、部分的ムーブを説明しています。上記" "コードで`ref`を削除すると、`person.age`の所有権が`age`変数にムーブされるた" @@ -9416,7 +9434,7 @@ msgstr "" #: src/scope/borrow.md:7 msgid "" -"The compiler statically guarantees (via its borrow checker) that references " +"The compiler statically guarantees (via its borrow checker) that references " "_always_ point to valid objects. That is, while references to an object " "exist, the object cannot be destroyed." msgstr "" @@ -9482,14 +9500,15 @@ msgstr "// ここで`_ref_to_i32`はスコープを抜け、借用もなくな msgid "" "// `boxed_i32` can now give up ownership to `eat_box_32` and be destroyed\n" msgstr "" -"// ここでようやく、`boxed_i32`は所有権を`eat_box_32`に移譲し、破棄することができます。\n" +"// ここでようやく、`boxed_i32`は所有権を`eat_box_32`に移譲し、破棄することが" +"できます。\n" #: src/scope/borrow/mut.md:3 msgid "" -"Mutable data can be mutably borrowed using `&mut T`. This is called a " +"Mutable data can be mutably borrowed using `&mut T`. This is called a " "_mutable reference_ and gives read/write access to the borrower. In " -"contrast, `&T` borrows the data via an immutable reference, and the " -"borrower can read the data but not modify it:" +"contrast, `&T` borrows the data via an immutable reference, and the borrower " +"can read the data but not modify it:" msgstr "" "ミュータブルなデータは`&mut T`でミュータブルに(変更可能な形で)借用すること" "ができます。これは *ミュータブルな参照* と呼ばれ、読み込み・書き込みの権限を" @@ -9656,7 +9675,7 @@ msgstr "\"Point now has coordinates: ({}, {}, {})\"" msgid "" "When doing pattern matching or destructuring via the `let` binding, the " "`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:" +"tuple. The example below shows a few instances where this can be useful:" msgstr "" "`let`を介してデストラクトやパターンマッチングを行う場合、`ref`キーワードを用" "いて構造体・タプルのフィールドへの参照を取得することができます。以下の例では" @@ -9839,9 +9858,9 @@ msgstr "" msgid "" "The borrow checker uses explicit lifetime annotations to determine how long " "references should be valid. In cases where lifetimes are not elided[^1], " -"Rust requires explicit annotations to determine what the lifetime of a " -"reference should be. The syntax for explicitly annotating a lifetime uses " -"an apostrophe character as follows: " +"Rust requires explicit annotations to determine what the lifetime of a " +"reference should be. The syntax for explicitly annotating a lifetime uses an " +"apostrophe character as follows:" msgstr "" "借用チェッカーは参照がどれだけの間有効かを決定するために、明示的なアノテー" "ションを使用します。ライフタイムが省略[^1]されなかった場合、Rustは参照のライ" @@ -9854,9 +9873,9 @@ msgstr "// `foo`は`'a`というライフタイムパラメータを持ちます #: src/scope/lifetime/explicit.md:14 msgid "" "Similar to [closures](../../fn/closures/anonymity.md), using lifetimes " -"requires generics. Additionally, this lifetime syntax indicates that the " -"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." +"requires generics. Additionally, this lifetime syntax indicates that the " +"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`のライフタイ" @@ -9962,7 +9981,7 @@ msgstr "[ジェネリクス](../../generics.md), [クロージャ](../../fn/clos #: src/scope/lifetime/fn.md:3 msgid "" "Ignoring [elision](elision.md), function signatures with lifetimes have a " -"few constraints: " +"few constraints:" msgstr "" "[省略](elision.md)をしない場合、ライフタイムのシグネチャ(e.g. `<'a>`)を持つ" "関数にはいくつかの制限があります。" @@ -10125,8 +10144,8 @@ msgstr "[トレイト](../../trait.md)" #: src/scope/lifetime/lifetime_bounds.md:3 msgid "" "Just like generic types can be bounded, lifetimes (themselves generic) use " -"bounds as well. The `:` character has a slightly different meaning here, " -"but `+` is the same. Note how the following read:" +"bounds as well. The `:` character has a slightly different meaning here, but " +"`+` is the same. Note how the following read:" msgstr "" "ジェネリック型に境界を与え、特定のトレイトを実装していることを保証できるのと" "同様、ライフタイム(それ自身ジェネリック型)にも境界を与えることができます。" @@ -10193,14 +10212,14 @@ msgstr "\"`print_ref`: t is {:?}\"" #: src/scope/lifetime/lifetime_bounds.md:48 msgid "" "[generics](../../generics.md), [bounds in generics](../../generics/bounds." -"md), and [multiple bounds in generics](../../generics/multi_bounds.md)" +"md), and [multiple bounds in generics](../../generics/multi_bounds.md)" msgstr "" "[ジェネリクス](../../generics.md), [ジェネリック境界](../../generics/bounds." "md), [複数の境界](../../generics/multi_bounds.md)" #: src/scope/lifetime/lifetime_coercion.md:3 msgid "" -"A longer lifetime can be coerced into a shorter one so that it works inside " +"A longer lifetime can be coerced into a shorter one so that it works inside " "a scope it normally wouldn't work in. This comes in the form of inferred " "coercion by the Rust compiler, and also in the form of declaring a lifetime " "difference:" @@ -10484,8 +10503,8 @@ msgstr "" #: src/trait.md:6 msgid "" "Traits can be implemented for any data type. In the example below, we define " -"`Animal`, a group of methods. The `Animal` `trait` is then implemented for " -"the `Sheep` data type, allowing the use of methods from `Animal` with a " +"`Animal`, a group of methods. The `Animal` `trait` is then implemented for " +"the `Sheep` data type, allowing the use of methods from `Animal` with a " "`Sheep`." msgstr "" "トレイトはあらゆるデータ型に実装することができます。以下の例ではまず`Animal`" @@ -10694,7 +10713,7 @@ msgid "" "requires. This means all your functions have to return a concrete type. " "Unlike other languages, if you have a trait like `Animal`, you can't write a " "function that returns `Animal`, because its different implementations will " -"need different amounts of memory. " +"need different amounts of memory." msgstr "" "Rustのコンパイラはあらゆる関数のリターン型に必要なスペースを知っておく必要が" "あります。つまり、すべての関数は具体的な型を返す必要があるのです。他の言語と" @@ -10832,7 +10851,7 @@ msgstr "" #: src/trait/drop.md:3 msgid "" "The [`Drop`](https://doc.rust-lang.org/std/ops/trait.Drop.html) trait only " -"has one method: `drop`, which is called automatically when an object goes " +"has one method: `drop`, which is called automatically when an object goes " "out of scope. The main use of the `Drop` trait is to free the resources that " "the implementor instance owns." msgstr "" @@ -11342,7 +11361,7 @@ msgstr "" #: src/trait/disambiguating.md:3 msgid "" "A type can implement many different traits. What if two traits both require " -"the same name for a function? For example, many traits might have a method " +"the same name for a function? For example, many traits might have a method " "named `get()`. They might even have different return types!" msgstr "" @@ -11594,7 +11613,7 @@ msgstr "" #: src/macros/overload.md:3 msgid "" -"Macros can be overloaded to accept different combinations of arguments. In " +"Macros can be overloaded to accept different combinations of arguments. In " "that regard, `macro_rules!` can work similarly to a match block:" msgstr "" "マクロは異なる引数の組み合わせを取るようにオーバーロードすることができるた" @@ -11913,7 +11932,7 @@ msgstr "" msgid "" "The previous section illustrates the error handling mechanism `panic`. " "Different code paths can be conditionally compiled based on the panic " -"setting. The current values available are `unwind` and `abort`. " +"setting. The current values available are `unwind` and `abort`." msgstr "" #: src/error/abort_unwind.md:6 @@ -12104,10 +12123,10 @@ msgstr "" #: src/error/option_unwrap/map.md:3 msgid "" -"`match` is a valid method for handling `Option`s. However, you may " -"eventually find heavy usage tedious, especially with operations only valid " +"`match` is a valid method for handling `Option`s. However, you may " +"eventually find heavy usage tedious, especially with operations only valid " "with an input. In these cases, [combinators](https://doc.rust-lang.org/" -"reference/glossary.html#combinator) can be used to manage control flow in a " +"reference/glossary.html#combinator) can be used to manage control flow in a " "modular fashion." msgstr "" "`match`は`Option`を扱うのに適したメソッドです。しかし、大量にこれを使用してい" @@ -12118,8 +12137,8 @@ msgstr "" #: src/error/option_unwrap/map.md:8 msgid "" -"`Option` has a built in method called `map()`, a combinator for the simple " -"mapping of `Some -> Some` and `None -> None`. Multiple `map()` calls can be " +"`Option` has a built in method called `map()`, a combinator for the simple " +"mapping of `Some -> Some` and `None -> None`. Multiple `map()` calls can be " "chained together for even more flexibility." msgstr "" "`Some -> Some`あるいは`None -> None`の単純な操作を適用する必要がある場合に" @@ -12194,11 +12213,11 @@ msgstr "" #: src/error/option_unwrap/and_then.md:3 msgid "" -"`map()` was described as a chainable way to simplify `match` statements. " -"However, using `map()` on a function that returns an `Option` results in " -"the nested `Option>`. Chaining multiple calls together can then " -"become confusing. That's where another combinator called `and_then()`, " -"known in some languages as flatmap, comes in." +"`map()` was described as a chainable way to simplify `match` statements. " +"However, using `map()` on a function that returns an `Option` results in " +"the nested `Option>`. Chaining multiple calls together can then " +"become confusing. That's where another combinator called `and_then()`, known " +"in some languages as flatmap, comes in." msgstr "" "先ほどは`map()`を、チェイン構文を用いて`match`文を単純化する物として説明しま" "した。しかし`Option`を返す関数に対しての`map()`の使用はネストした" @@ -12216,8 +12235,8 @@ msgstr "" #: src/error/option_unwrap/and_then.md:11 msgid "" -"In the following example, `cookable_v3()` results in an `Option`. " -"Using `map()` instead of `and_then()` would have given an " +"In the following example, `cookable_v3()` results in an `Option`. " +"Using `map()` instead of `and_then()` would have given an " "`Option>`, which is an invalid type for `eat()`." msgstr "" "以下の例では`cookable_v3()`は`Option`を返すため、`and_then()`ではなく" @@ -13388,7 +13407,7 @@ msgstr "" #: src/std/box.md:8 msgid "" "Boxed values can be dereferenced using the `*` operator; this removes one " -"layer of indirection. " +"layer of indirection." msgstr "" "ボックス化された値は`*`演算子を用いてデリファレンスすることができます。これに" "より一段と直接的な操作が可能になります。" @@ -13459,7 +13478,7 @@ msgstr "\"Unboxed point occupies {} bytes on the stack\"" msgid "" "Vectors are re-sizable arrays. Like slices, their size is not known at " "compile time, but they can grow or shrink at any time. A vector is " -"represented using 3 parameters: " +"represented using 3 parameters:" msgstr "" "「ベクタ」はサイズを変更可能な配列です。スライスと同様、そのサイズはコンパイ" "ル時には不定ですが、いつでも要素を追加したり削除したりすることができます。ベ" @@ -13474,14 +13493,14 @@ msgid "length" msgstr "長さ" #: src/std/vec.md:8 -msgid "capacity " +msgid "capacity" msgstr "容量" #: src/std/vec.md:10 msgid "" "The capacity indicates how much memory is reserved for the vector. The " -"vector can grow as long as the length is smaller than the capacity. When " -"this threshold needs to be surpassed, the vector is reallocated with a " +"vector can grow as long as the length is smaller than the capacity. When " +"this threshold needs to be surpassed, the vector is reallocated with a " "larger capacity." msgstr "" "ベクタはその容量を超えない限りにおいて長くしていくことができます。超えた場合" @@ -13979,7 +13998,7 @@ msgid "" "We've seen that the `Option` enum can be used as a return value from " "functions that may fail, where `None` can be returned to indicate failure. " "However, sometimes it is important to express _why_ an operation failed. To " -"do this we have the `Result` enum." +"do this we have the `Result` enum." msgstr "" "これまでの例で、失敗する可能性のある関数の返り値として、列挙型`Option`が使用" "でき、失敗時の返り値には`None`を用いることを見てきました。しかし、時には **な" @@ -14042,7 +14061,7 @@ msgid "" "Chaining results using match can get pretty untidy; luckily, the `?` " "operator can be used to make things pretty again. `?` is used at the end of " "an expression returning a `Result`, and is equivalent to a match expression, " -"where the `Err(err)` branch expands to an early `return Err(From::" +"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 "" "マッチを利用して結果をチェインするのは中々面倒です。幸いなことに、`?`マクロを" @@ -14138,9 +14157,8 @@ msgstr "`panic!`がメモリリークを引き起こさないことを確認し #: src/std/hash.md:3 msgid "" "Where vectors store values by an integer index, `HashMap`s store values by " -"key. `HashMap` keys can be booleans, integers, strings, or any other type " -"that implements the `Eq` and `Hash` traits. More on this in the next " -"section." +"key. `HashMap` keys can be booleans, integers, strings, or any other type " +"that implements the `Eq` and `Hash` traits. More on this in the next section." msgstr "" "ベクタ型が値を整数のインデックスで保持するのに対し、`HashMap`ではキーで保持し" "ます。`HashMap`のキーはブーリアン、整数、文字列等の`Eq`と`Hash`トレイトを保持" @@ -14149,9 +14167,9 @@ msgstr "" #: src/std/hash.md:8 msgid "" "Like vectors, `HashMap`s are growable, but HashMaps can also shrink " -"themselves when they have excess space. You can create a HashMap with a " -"certain starting capacity using `HashMap::with_capacity(uint)`, or use " -"`HashMap::new()` to get a HashMap with a default initial capacity " +"themselves when they have excess space. You can create a HashMap with a " +"certain starting capacity using `HashMap::with_capacity(uint)`, or use " +"`HashMap::new()` to get a HashMap with a default initial capacity " "(recommended)." msgstr "" "ベクタ型と同様、伸長可能ですが、`HashMap`の場合さらに、スペースが余っていると" @@ -14258,9 +14276,9 @@ msgstr "\"Calling {}: {}\"" #: src/std/hash.md:60 msgid "" -"For more information on how hashing and hash maps (sometimes called hash " -"tables) work, have a look at [Hash Table Wikipedia](https://en.wikipedia." -"org/wiki/Hash_table)" +"For more information on how hashing and hash maps (sometimes called hash " +"tables) work, have a look at [Hash Table Wikipedia](https://en.wikipedia.org/" +"wiki/Hash_table)" msgstr "" "ハッシングやハッシュマップ(ハッシュテーブルと呼ばれることもあります)の仕組" "みについて、より詳しく知りたい場合は[Wikipediaのハッシュテーブルのページ]" @@ -14269,7 +14287,7 @@ msgstr "" #: 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:" +"`HashMap`. This includes:" msgstr "" "`Eq`と`Hash`トレイトを実装している型ならば、なんでも`HashMap`のキーになること" "ができます。例えば以下です。" @@ -14304,8 +14322,8 @@ msgstr "" #: src/std/hash/alt_key_types.md:15 msgid "" -"All collection classes implement `Eq` and `Hash` if their contained type " -"also respectively implements `Eq` and `Hash`. For example, `Vec` will " +"All collection classes implement `Eq` and `Hash` if their contained type " +"also respectively implements `Eq` and `Hash`. For example, `Vec` will " "implement `Hash` if `T` implements `Hash`." msgstr "" "集合型は、その要素となっている全ての型が`Eq`を、あるいは`Hash`を実装している" @@ -14315,16 +14333,16 @@ msgstr "" #: src/std/hash/alt_key_types.md:19 msgid "" "You can easily implement `Eq` and `Hash` for a custom type with just one " -"line: `#[derive(PartialEq, Eq, Hash)]`" +"line: `#[derive(PartialEq, Eq, Hash)]`" msgstr "" "独自の型に`Eq`あるいは`Hash`を実装するのは簡単です。以下の一行で済みます。" "`#[derive(PartialEq, Eq, Hash)]`" #: src/std/hash/alt_key_types.md:22 msgid "" -"The compiler will do the rest. If you want more control over the details, " -"you can implement `Eq` and/or `Hash` yourself. This guide will not cover " -"the specifics of implementing `Hash`. " +"The compiler will do the rest. If you want more control over the details, " +"you can implement `Eq` and/or `Hash` yourself. This guide will not cover the " +"specifics of implementing `Hash`." msgstr "" "後はコンパイラがよしなにしてくれます。これらのトレイトの詳細をコントロールし" "たい場合、`Eq`や`Hash`を自分で実装することもできます。この文書では`Hash`トレ" @@ -14332,7 +14350,7 @@ msgstr "" #: src/std/hash/alt_key_types.md:26 msgid "" -"To play around with using a `struct` in `HashMap`, let's try making a very " +"To play around with using a `struct` in `HashMap`, let's try making a very " "simple user logon system:" msgstr "" "`struct`を`HashMap`で扱う際の例として、とてもシンプルなユーザーログインシステ" @@ -14410,10 +14428,10 @@ msgstr "" #: src/std/hash/hashset.md:8 msgid "" -"A `HashSet`'s unique feature is that it is guaranteed to not have duplicate " -"elements. That's the contract that any set collection fulfills. `HashSet` " -"is just one implementation. (see also: [`BTreeSet`](https://doc.rust-lang." -"org/std/collections/struct.BTreeSet.html))" +"A `HashSet`'s unique feature is that it is guaranteed to not have duplicate " +"elements. That's the contract that any set collection fulfills. `HashSet` is " +"just one implementation. (see also: [`BTreeSet`](https://doc.rust-lang.org/" +"std/collections/struct.BTreeSet.html))" msgstr "" "それは、`HashSet`独自の機能として、要素に重複がないということが保証されるため" "です。これは全ての集合型がもつ機能です。`HashSet`はその実装の1つであり、他に" @@ -14422,8 +14440,8 @@ msgstr "" #: src/std/hash/hashset.md:13 msgid "" -"If you insert a value that is already present in the `HashSet`, (i.e. the " -"new value is equal to the existing and they both have the same hash), then " +"If you insert a value that is already present in the `HashSet`, (i.e. the " +"new value is equal to the existing and they both have the same hash), then " "the new value will replace the old." msgstr "" "`HashSet`に、すでに存在する値を加えようとすると、(すなわち、加えようとしてい" @@ -14432,14 +14450,14 @@ msgstr "" #: src/std/hash/hashset.md:17 msgid "" -"This is great for when you never want more than one of something, or when " +"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つ以上欲しくない場合や、すでにある値を持っているか知りたい場" "合にとても有効です。" #: src/std/hash/hashset.md:20 -msgid "But sets can do more than that. " +msgid "But sets can do more than that." msgstr "しかし、集合型の機能はそれだけではありません。" #: src/std/hash/hashset.md:22 @@ -14464,7 +14482,7 @@ msgstr "`intersection`:両方の集合にある値のみを取得。" #: src/std/hash/hashset.md:30 msgid "" -"`symmetric_difference`: get all the elements that are in one set or the " +"`symmetric_difference`: get all the elements that are in one set or the " "other, but _not_ both." msgstr "" "`symmetric_difference`:どちらか一方の集合には存在するが、両方には **ない** " @@ -14548,7 +14566,7 @@ msgstr "" msgid "" "When multiple ownership is needed, `Rc`(Reference Counting) can be used. " "`Rc` keeps track of the number of the references which means the number of " -"owners of the value wrapped inside an `Rc`. " +"owners of the value wrapped inside an `Rc`." msgstr "" #: src/std/rc.md:5 @@ -14556,7 +14574,7 @@ msgid "" "Reference count of an `Rc` increases by 1 whenever an `Rc` is cloned, and " "decreases by 1 whenever one cloned `Rc` is dropped out of the scope. When an " "`Rc`'s reference count becomes zero (which means there are no remaining " -"owners), both the `Rc` and the value are all dropped. " +"owners), both the `Rc` and the value are all dropped." msgstr "" #: src/std/rc.md:7 @@ -15044,8 +15062,8 @@ msgstr "" #: src/std_misc/path.md:11 msgid "" "A `Path` is immutable. The owned version of `Path` is `PathBuf`. The " -"relation between `Path` and `PathBuf` is similar to that of `str` and " -"`String`: a `PathBuf` can be mutated in-place, and can be dereferenced to a " +"relation between `Path` and `PathBuf` is similar to that of `str` and " +"`String`: a `PathBuf` can be mutated in-place, and can be dereferenced to a " "`Path`." msgstr "" "`Path`はイミュータブルです。`Path`の所有権ありのバージョンが`PathBuf`です。" @@ -15057,7 +15075,7 @@ msgid "" "Note that a `Path` is _not_ internally represented as an UTF-8 string, but " "instead is stored as an `OsString`. Therefore, converting a `Path` to a " "`&str` is _not_ free and may fail (an `Option` is returned). However, a " -"`Path` can be freely converted to an `OsString` or `&OsStr` using " +"`Path` can be freely converted to an `OsString` or `&OsStr` using " "`into_os_string` and `as_os_str`, respectively." msgstr "" "`Path`の実態はUTF-8の文字列 **ではなく** 、`OsString`であることに注意しましょ" @@ -16151,10 +16169,10 @@ msgstr "" #: src/testing/doc_testing.md:3 msgid "" "The primary way of documenting a Rust project is through annotating the " -"source code. Documentation comments are written in [CommonMark Markdown " +"source code. Documentation comments are written in [CommonMark Markdown " "specification](https://commonmark.org/) and support code blocks in them. " "Rust takes care about correctness, so these code blocks are compiled and " -"used as documentation tests." +"used as documentation tests." msgstr "" "Rustのプロジェクトでは、ソースコードに注釈する形でドキュメントを書くのが主流" "です。ドキュメンテーションコメントの記述は[CommonMark Markdown specification]" @@ -16475,7 +16493,7 @@ msgstr "生ポインタのデリファレンス" #: src/unsafe.md:10 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) " +"function over FFI, see [a previous chapter](std_misc/ffi.md) of the book)" msgstr "" "安全でない関数やメソッドの呼び出し(FFI経由の関数の呼び出しを含む (詳細は [本" "書のFFIに関する説明](std_misc/ffi.md) を参照ください))" @@ -16523,9 +16541,9 @@ msgstr "" #: src/unsafe.md:54 msgid "" "For `slice::from_raw_parts`, one of the assumptions which _must_ be upheld " -"is that the pointer passed in points to valid memory and that the memory " +"is that the pointer passed in points to valid memory and that the memory " "pointed to is of the correct type. If these invariants aren't upheld then " -"the program's behaviour is undefined and there is no knowing what will " +"the program's behaviour is undefined and there is no knowing what will " "happen." msgstr "" "`slice::from_raw_parts` は、次のふたつの仮定に基づいて処理します。ひとつは渡" @@ -16743,7 +16761,7 @@ msgid "" "won't have to be saved and reloaded around the inline assembly block. To " "achieve this Rust provides a `lateout` specifier. This can be used on any " "output that is written only after all inputs have been consumed. There is " -"also an `inlateout` variant of this specifier." +"also an `inlateout` variant of this specifier." msgstr "" "Rustコンパイラはオペランドの割り当てに保守的です。`out`はいつでも書き込めるの" "で、他の引数とは場所を共有できません。しかし、最適なパフォーマンスを保証する" @@ -16775,7 +16793,7 @@ msgid "" "`inlateout(reg) a` in the above example can continue to give the expected " "result. However, with `release` mode or other optimized cases, using " "`inlateout(reg) a` can instead lead to the final value `a = 16`, causing the " -"assertion to fail. " +"assertion to fail." msgstr "" #: src/unsafe/asm.md:169 @@ -16785,7 +16803,7 @@ msgid "" "value. Furthermore, when `inlateout` is used, `a` and `c` could be allocated " "to the same register, in which case the first `add` instruction would " "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`. " +"using `inout(reg) a` ensures a separate register is allocated for `a`." msgstr "" "というのも、最適化されている場合、コンパイラは`b`と`c`が同じ値だと知っている" "ので、`b`と`c`の入力に同じレジスタを割り当てる場合があります。もし`inlateout`" @@ -17298,8 +17316,8 @@ msgstr "" "llvm.org/show_bug.cgi?id=36144)によって、`0`、`11`、`101010`といった`0`と`1`" "だけで構成されたラベルは、バイナリ値として解釈されてしまうため、使用してはい" "けません。`options(att_syntax)`を使うと曖昧さを避けられますが、`asm!`ブロッ" -"ク _全体_ の構文に影響します。(`options`については、後述の[オプション](#options" -")を参照してください。)" +"ク _全体_ の構文に影響します。(`options`については、後述の[オプション]" +"(#options)を参照してください。)" #: src/unsafe/asm.md:424 msgid "\"mov {0}, 10\"" @@ -17805,6 +17823,16 @@ msgid "" "[The rustdoc Book](https://doc.rust-lang.org/rustdoc/what-is-rustdoc.html)" msgstr "" +#~ msgid "" +#~ "Using the `Into` trait will typically require specification of the type " +#~ "to convert into as the compiler is unable to determine this most of the " +#~ "time. However this is a small trade-off considering we get the " +#~ "functionality for free." +#~ msgstr "" +#~ "`Into`トレイトを使用すると、ほとんどの場合、コンパイラが型を決定することが" +#~ "できないため、変換する型を指定する必要があります。しかし、この機能を無料で" +#~ "得られることを考えれば、これは小さなトレードオフです。" + #~ msgid "\"Base 16 (hexadecimal): {:X}\"" #~ msgstr "\"Base 16 (hexadecimal): {:X}\""