Skip to content

Commit 4905814

Browse files
committed
add matching to errorkind
1 parent 5bd1ec3 commit 4905814

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

library/std/src/io/error.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,14 @@ struct Custom {
141141
/// It is used with the [`io::Error`] type.
142142
///
143143
/// [`io::Error`]: Error
144+
///
145+
/// # Handling errors and matching on `ErrorKind`
146+
///
147+
/// In application code, use `match` for the `ErrorKind` values you are expecting; use `_` to match
148+
/// "all other errors".
149+
///
150+
/// In comprehensive and thorough tests, you may need to cut-and-paste the current list of
151+
/// errors from here into your test code.
144152
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
145153
#[stable(feature = "rust1", since = "1.0.0")]
146154
#[allow(deprecated)]

0 commit comments

Comments
 (0)