Skip to content

Commit ccc309d

Browse files
committed
Fix typo and improve Japanese
1 parent f06ccdd commit ccc309d

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

1.6/ja/book/error-handling.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ Rustでは戻り値を使います。
116116
# // Guess a number between 1 and 10.
117117
# // If it matches the number we had in mind, return true. Else, return false.
118118
// 1から10までの数字を予想します。
119-
// もし予想した数字に一致したらtrueを返し、そうでなけれは、falseを返します
119+
// もし予想した数字に一致したらtrueを返し、そうでなければfalseを返します
120120
fn guess(n: i32) -> bool {
121121
if n < 1 || n > 10 {
122122
panic!("Invalid number: {}", n);
@@ -314,7 +314,7 @@ impl<T> Option<T> {
314314
> 訳注:
315315
>
316316
> called `Option::unwrap()` on a `None` value:<br/>
317-
> `None` な値に対して `Option:unwpal()` が呼ばれました
317+
> `None` な値に対して `Option:unwrap()` が呼ばれました
318318
319319
<!-- The `unwrap` method *abstracts away the case analysis*. This is precisely the thing -->
320320
<!-- that makes `unwrap` ergonomic to use. Unfortunately, that `panic!` means that -->
@@ -1178,7 +1178,7 @@ fn main() {
11781178
<!-- `map_err`. -->
11791179
このコードは、やや難解になってきました。
11801180
このようなコードを簡単に書けるようになるまでには、結構な量の練習が必要かもしれません。
1181-
こういうもの書くときは *型に導かれる* ようにします。
1181+
こういうものを書くときは *型に導かれる* ようにします。
11821182
`file_double` のリターン型を `Result<i32, String>` に変更したらすぐに、それに合ったコンビネータを探し始めるのです。
11831183
この例では `and_then`, `map`, `map_err` の、3種類のコンビネータだけを使いました。
11841184

@@ -1188,7 +1188,7 @@ fn main() {
11881188
<!-- Correspondingly, there are two calls to `and_then`. -->
11891189
`and_then` は、エラーを返すかもしれない処理同士を繋いでいくために使います。
11901190
ファイルを開いた後に、失敗するかもしれない処理が2つあります:
1191-
ファイルからの読み込む所と、内容を数値としてパースする所です。
1191+
ファイルから読み込む所と、内容を数値としてパースする所です。
11921192
これに対応して `and_then` も2回呼ばれています。
11931193

11941194
<!-- `map` is used to apply a function to the `Ok(...)` value of a `Result`. For -->
@@ -1855,7 +1855,7 @@ fn file_double<P: AsRef<Path>>(file_path: P) -> Result<i32, Box<Error>> {
18551855
<!-- automatic type conversion for us by calling `From::from` on the error value. -->
18561856
<!-- In particular, we converted errors to `Box<Error>`, which works, but the type -->
18571857
<!-- is opaque to callers. -->
1858-
最後の節では `try!` マクロの本当の定義を確認し、それが `From::from` をエラーの値に対して呼ぶことで、自動的な型変換をする様子を見ました。
1858+
前の節では `try!` マクロの本当の定義を確認し、それが `From::from` をエラーの値に対して呼ぶことで、自動的な型変換をする様子を見ました。
18591859
特にそこでは、エラーを `Box<Error>` に変換しました。
18601860
これはたしかに動きますが、呼び出し元にとって、型がオペークになってしまいました。
18611861

1.9/ja/book/error-handling.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ Rustでは戻り値を使います。
116116
# // Guess a number between 1 and 10.
117117
# // If it matches the number we had in mind, return true. Else, return false.
118118
// 1から10までの数字を予想します。
119-
// もし予想した数字に一致したらtrueを返し、そうでなけれは、falseを返します
119+
// もし予想した数字に一致したらtrueを返し、そうでなければfalseを返します
120120
fn guess(n: i32) -> bool {
121121
if n < 1 || n > 10 {
122122
panic!("Invalid number: {}", n);
@@ -314,7 +314,7 @@ impl<T> Option<T> {
314314
> 訳注:
315315
>
316316
> called `Option::unwrap()` on a `None` value:<br/>
317-
> `None` な値に対して `Option:unwpal()` が呼ばれました
317+
> `None` な値に対して `Option:unwrap()` が呼ばれました
318318
319319
<!-- The `unwrap` method *abstracts away the case analysis*. This is precisely the thing -->
320320
<!-- that makes `unwrap` ergonomic to use. Unfortunately, that `panic!` means that -->
@@ -1178,7 +1178,7 @@ fn main() {
11781178
<!-- `map_err`. -->
11791179
このコードは、やや難解になってきました。
11801180
このようなコードを簡単に書けるようになるまでには、結構な量の練習が必要かもしれません。
1181-
こういうもの書くときは *型に導かれる* ようにします。
1181+
こういうものを書くときは *型に導かれる* ようにします。
11821182
`file_double` のリターン型を `Result<i32, String>` に変更したらすぐに、それに合ったコンビネータを探し始めるのです。
11831183
この例では `and_then`, `map`, `map_err` の、3種類のコンビネータだけを使いました。
11841184

@@ -1188,7 +1188,7 @@ fn main() {
11881188
<!-- Correspondingly, there are two calls to `and_then`. -->
11891189
`and_then` は、エラーを返すかもしれない処理同士を繋いでいくために使います。
11901190
ファイルを開いた後に、失敗するかもしれない処理が2つあります:
1191-
ファイルからの読み込む所と、内容を数値としてパースする所です。
1191+
ファイルから読み込む所と、内容を数値としてパースする所です。
11921192
これに対応して `and_then` も2回呼ばれています。
11931193

11941194
<!-- `map` is used to apply a function to the `Ok(...)` value of a `Result`. For -->
@@ -1855,7 +1855,7 @@ fn file_double<P: AsRef<Path>>(file_path: P) -> Result<i32, Box<Error>> {
18551855
<!-- automatic type conversion for us by calling `From::from` on the error value. -->
18561856
<!-- In particular, we converted errors to `Box<Error>`, which works, but the type -->
18571857
<!-- is opaque to callers. -->
1858-
最後の節では `try!` マクロの本当の定義を確認し、それが `From::from` をエラーの値に対して呼ぶことで、自動的な型変換をする様子を見ました。
1858+
前の節では `try!` マクロの本当の定義を確認し、それが `From::from` をエラーの値に対して呼ぶことで、自動的な型変換をする様子を見ました。
18591859
特にそこでは、エラーを `Box<Error>` に変換しました。
18601860
これはたしかに動きますが、呼び出し元にとって、型がオペークになってしまいました。
18611861

0 commit comments

Comments
 (0)