word wrpa
This commit is contained in:
parent
c46d9f6c89
commit
eb795c24fb
1 changed files with 9 additions and 6 deletions
|
@ -144,13 +144,16 @@ struct Custom {
|
||||||
///
|
///
|
||||||
/// # Handling errors and matching on `ErrorKind`
|
/// # Handling errors and matching on `ErrorKind`
|
||||||
///
|
///
|
||||||
/// In application code, use `match` for the `ErrorKind` values you are expecting; use `_` to match
|
/// In application code, use `match` for the `ErrorKind` values you are
|
||||||
/// "all other errors".
|
/// expecting; use `_` to match "all other errors".
|
||||||
///
|
///
|
||||||
/// In comprehensive and thorough tests that want to verify that a test doesn't return any known incorrect error kind,
|
/// In comprehensive and thorough tests that want to verify that a test doesn't
|
||||||
/// 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,
|
/// return any known incorrect error kind, you may want to cut-and-paste the
|
||||||
/// but it will make your tests more robust. In particular, if you want to verify that your code does produce an
|
/// current full list of errors from here into your test code, and then match
|
||||||
/// unrecognized error kind, the robust solution is to check for all the recognized error kinds and fail in those cases.
|
/// `_` as the correct case. This seems counterintuitive, but it will make your
|
||||||
|
/// tests more robust. In particular, if you want to verify that your code does
|
||||||
|
/// produce an unrecognized error kind, the robust solution is to check for all
|
||||||
|
/// the recognized error kinds and fail in those cases.
|
||||||
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
|
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[allow(deprecated)]
|
#[allow(deprecated)]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue