Skip to content

Commit cd8fa8c

Browse files
committed
コメントの位置修正
1 parent 2317c20 commit cd8fa8c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/ch09-02-recoverable-errors-with-result.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -350,14 +350,14 @@ If we run this code without a *hello.txt* file, we’ll see an error message fro
350350
the `panic!` call that the `unwrap` method makes:
351351
-->
352352

353+
このコードを*hello.txt*ファイルなしで走らせたら、`unwrap`メソッドが行う`panic!`呼び出しからのエラーメッセージを目の当たりにするでしょう:
354+
353355
<!-- manual-regeneration
354356
cd listings/ch09-error-handling/no-listing-04-unwrap
355357
cargo run
356358
copy and paste relevant text
357359
-->
358360

359-
このコードを*hello.txt*ファイルなしで走らせたら、`unwrap`メソッドが行う`panic!`呼び出しからのエラーメッセージを目の当たりにするでしょう:
360-
361361
```text
362362
thread 'main' panicked at src/main.rs:4:49:
363363
called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }
@@ -393,16 +393,16 @@ will be the parameter that we pass to `expect`, rather than the default
393393
`panic!` message that `unwrap` uses. Here’s what it looks like:
394394
-->
395395

396+
`expect``unwrap`と同じように使用してます: ファイルハンドルを返したり、`panic!`マクロを呼び出しています。
397+
`expect``panic!`呼び出しで使用するエラーメッセージは、`unwrap`が使用するデフォルトの`panic!`メッセージではなく、
398+
`expect`に渡した引数になります。以下のようになります:
399+
396400
<!-- manual-regeneration
397401
cd listings/ch09-error-handling/no-listing-05-expect
398402
cargo run
399403
copy and paste relevant text
400404
-->
401405

402-
`expect``unwrap`と同じように使用してます: ファイルハンドルを返したり、`panic!`マクロを呼び出しています。
403-
`expect``panic!`呼び出しで使用するエラーメッセージは、`unwrap`が使用するデフォルトの`panic!`メッセージではなく、
404-
`expect`に渡した引数になります。以下のようになります:
405-
406406
```text
407407
thread 'main' panicked at src/main.rs:5:10:
408408
hello.txt should be included in this project: Os { code: 2, kind: NotFound, message: "No such file or directory" }

0 commit comments

Comments
 (0)