You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: library/std/src/io/error.rs
+9-6
Original file line number
Diff line number
Diff line change
@@ -144,13 +144,16 @@ struct Custom {
144
144
///
145
145
/// # Handling errors and matching on `ErrorKind`
146
146
///
147
-
/// In application code, use `match` for the `ErrorKind` values you are expecting; use `_` to match
148
-
/// "all other errors".
147
+
/// In application code, use `match` for the `ErrorKind` values you are
148
+
/// expecting; use `_` to match "all other errors".
149
149
///
150
-
/// In comprehensive and thorough tests that want to verify that a test doesn't return any known incorrect error kind,
151
-
/// you may want to cut-and-paste the current full list of errors from here into your test code, and then match `_` as the correct case. This seems counterintuitive,
152
-
/// but it will make your tests more robust. In particular, if you want to verify that your code does produce an
153
-
/// unrecognized error kind, the robust solution is to check for all the recognized error kinds and fail in those cases.
150
+
/// In comprehensive and thorough tests that want to verify that a test doesn't
151
+
/// return any known incorrect error kind, you may want to cut-and-paste the
152
+
/// current full list of errors from here into your test code, and then match
153
+
/// `_` as the correct case. This seems counterintuitive, but it will make your
154
+
/// tests more robust. In particular, if you want to verify that your code does
155
+
/// produce an unrecognized error kind, the robust solution is to check for all
156
+
/// the recognized error kinds and fail in those cases.
0 commit comments