From 3647f8d61b0c9ba1716d9ea041f4606aab35dcf9 Mon Sep 17 00:00:00 2001 From: davidOSUL <32912896+davidOSUL@users.noreply.github.com> Date: Sat, 29 Aug 2020 14:02:19 -0400 Subject: [PATCH 1/2] Update question-mark-in-main-and-tests.md --- .../question-mark-in-main-and-tests.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rust-2018/error-handling-and-panics/question-mark-in-main-and-tests.md b/src/rust-2018/error-handling-and-panics/question-mark-in-main-and-tests.md index 5a810055..4a93143e 100644 --- a/src/rust-2018/error-handling-and-panics/question-mark-in-main-and-tests.md +++ b/src/rust-2018/error-handling-and-panics/question-mark-in-main-and-tests.md @@ -75,7 +75,9 @@ fn main() -> Result<(), std::io::Error> { In this case, if say the file doesn't exist and there is an `Err(err)` somewhere, then `main` will exit with an error code (not `0`) and print out a `Debug` -representation of `err`. +representation of `err`. Note that this will always print the `Debug` representation. +If you would like to, for example, print out the `Display` representation of `err`, +you will still have to do what you would in Rust 2015. ## More details From 90077f2b0a579ee915841abc707d0c0853c7e0fc Mon Sep 17 00:00:00 2001 From: davidOSUL <32912896+davidOSUL@users.noreply.github.com> Date: Sat, 29 Aug 2020 14:02:59 -0400 Subject: [PATCH 2/2] Update question-mark-in-main-and-tests.md --- .../question-mark-in-main-and-tests.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rust-2018/error-handling-and-panics/question-mark-in-main-and-tests.md b/src/rust-2018/error-handling-and-panics/question-mark-in-main-and-tests.md index 4a93143e..4c116b56 100644 --- a/src/rust-2018/error-handling-and-panics/question-mark-in-main-and-tests.md +++ b/src/rust-2018/error-handling-and-panics/question-mark-in-main-and-tests.md @@ -75,7 +75,7 @@ fn main() -> Result<(), std::io::Error> { In this case, if say the file doesn't exist and there is an `Err(err)` somewhere, then `main` will exit with an error code (not `0`) and print out a `Debug` -representation of `err`. Note that this will always print the `Debug` representation. +representation of `err`. Note that this will always print out the `Debug` representation. If you would like to, for example, print out the `Display` representation of `err`, you will still have to do what you would in Rust 2015.