@@ -350,14 +350,14 @@ If we run this code without a *hello.txt* file, we’ll see an error message fro
350
350
the `panic!` call that the `unwrap` method makes:
351
351
-->
352
352
353
+ このコードを* hello.txt* ファイルなしで走らせたら、` unwrap ` メソッドが行う` panic! ` 呼び出しからのエラーメッセージを目の当たりにするでしょう:
354
+
353
355
<!-- manual-regeneration
354
356
cd listings/ch09-error-handling/no-listing-04-unwrap
355
357
cargo run
356
358
copy and paste relevant text
357
359
-->
358
360
359
- このコードを* hello.txt* ファイルなしで走らせたら、` unwrap ` メソッドが行う` panic! ` 呼び出しからのエラーメッセージを目の当たりにするでしょう:
360
-
361
361
``` text
362
362
thread 'main' panicked at src/main.rs:4:49:
363
363
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
393
393
`panic!` message that `unwrap` uses. Here’s what it looks like:
394
394
-->
395
395
396
+ ` expect ` を` unwrap ` と同じように使用してます: ファイルハンドルを返したり、` panic! ` マクロを呼び出しています。
397
+ ` expect ` が` panic! ` 呼び出しで使用するエラーメッセージは、` unwrap ` が使用するデフォルトの` panic! ` メッセージではなく、
398
+ ` expect ` に渡した引数になります。以下のようになります:
399
+
396
400
<!-- manual-regeneration
397
401
cd listings/ch09-error-handling/no-listing-05-expect
398
402
cargo run
399
403
copy and paste relevant text
400
404
-->
401
405
402
- ` expect ` を` unwrap ` と同じように使用してます: ファイルハンドルを返したり、` panic! ` マクロを呼び出しています。
403
- ` expect ` が` panic! ` 呼び出しで使用するエラーメッセージは、` unwrap ` が使用するデフォルトの` panic! ` メッセージではなく、
404
- ` expect ` に渡した引数になります。以下のようになります:
405
-
406
406
``` text
407
407
thread 'main' panicked at src/main.rs:5:10:
408
408
hello.txt should be included in this project: Os { code: 2, kind: NotFound, message: "No such file or directory" }
0 commit comments