@@ -350,14 +350,14 @@ If we run this code without a *hello.txt* file, we’ll see an error message fro
350350the `panic!` call that the `unwrap` method makes:
351351-->
352352
353+ このコードを* hello.txt* ファイルなしで走らせたら、` unwrap ` メソッドが行う` panic! ` 呼び出しからのエラーメッセージを目の当たりにするでしょう:
354+
353355<!-- manual-regeneration
354356cd listings/ch09-error-handling/no-listing-04-unwrap
355357cargo run
356358copy and paste relevant text
357359-->
358360
359- このコードを* hello.txt* ファイルなしで走らせたら、` unwrap ` メソッドが行う` panic! ` 呼び出しからのエラーメッセージを目の当たりにするでしょう:
360-
361361``` text
362362thread 'main' panicked at src/main.rs:4:49:
363363called `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
397401cd listings/ch09-error-handling/no-listing-05-expect
398402cargo run
399403copy and paste relevant text
400404-->
401405
402- ` expect ` を` unwrap ` と同じように使用してます: ファイルハンドルを返したり、` panic! ` マクロを呼び出しています。
403- ` expect ` が` panic! ` 呼び出しで使用するエラーメッセージは、` unwrap ` が使用するデフォルトの` panic! ` メッセージではなく、
404- ` expect ` に渡した引数になります。以下のようになります:
405-
406406``` text
407407thread 'main' panicked at src/main.rs:5:10:
408408hello.txt should be included in this project: Os { code: 2, kind: NotFound, message: "No such file or directory" }
0 commit comments