@@ -1047,8 +1047,8 @@ impl<T, E> Result<T, E> {
1047
1047
/// .expect("env variable `IMPORTANT_PATH` is not set");
1048
1048
/// ```
1049
1049
///
1050
- /// In the latter style, we would instead describe the reason we _expect_ the `Result` will
1051
- /// always be `Ok`. With this style we would instead write:
1050
+ /// In the "expect as precondition" style, we would instead describe the reason we _expect_ the
1051
+ /// `Result` will always be `Ok`. With this style we would prefer to write:
1052
1052
///
1053
1053
/// ```should_panic
1054
1054
/// let path = std::env::var("IMPORTANT_PATH")
@@ -1060,7 +1060,7 @@ impl<T, E> Result<T, E> {
1060
1060
/// `std`.
1061
1061
///
1062
1062
/// ```text
1063
- /// thread 'expect_as_error_message ' panicked at 'env variable `IMPORTANT_PATH` is not set: NotPresent', src/lib .rs:4:10
1063
+ /// thread 'main ' panicked at 'env variable `IMPORTANT_PATH` is not set: NotPresent', src/main .rs:4:6
1064
1064
/// ```
1065
1065
///
1066
1066
/// The "expect as precondition" style instead focuses on source code readability, making it
@@ -1069,13 +1069,13 @@ impl<T, E> Result<T, E> {
1069
1069
/// directly to users with the default `std` panic hook's report format:
1070
1070
///
1071
1071
/// ```text
1072
- /// thread 'expect_as_precondition ' panicked at 'env variable `IMPORTANT_PATH` is always set by `wrapper_script.sh`: NotPresent', src/lib .rs:4:10
1072
+ /// thread 'main ' panicked at 'env variable `IMPORTANT_PATH` is always be set by `wrapper_script.sh`: NotPresent', src/main .rs:4:6
1073
1073
/// ```
1074
1074
///
1075
1075
/// This style works best when paired with a custom [panic hook] like the one provided by the
1076
- /// CLI working group library, [`human-panic`], which redirects panic messages to crash report
1077
- /// files while showing users a more "Oops, something went wrong!" message with a suggestion to
1078
- /// send the crash report file back to the developers.
1076
+ /// CLI working group library, [`human-panic`], which dumps the panic messages to a crash
1077
+ /// report file while showing users a more friendly "Oops, something went wrong!" message with
1078
+ /// a suggestion to send the crash report file back to the developers.
1079
1079
///
1080
1080
/// [panic hook]: https://doc.rust-lang.org/stable/std/panic/fn.set_hook.html
1081
1081
/// [`human-panic`]: https://docs.rs/human-panic
0 commit comments