@@ -200,11 +200,11 @@ An error type is any type `E` used in a `Result<T, E>` returned by any public
200
200
function of your crate. Error types should always implement the
201
201
[ ` std::error::Error ` ] trait which is the mechanism by which error handling
202
202
libraries like [ ` error-chain ` ] abstract over different types of errors, and
203
- which allows the error to be used as the [ ` cause ()` ] of another error.
203
+ which allows the error to be used as the [ ` source ()` ] of another error.
204
204
205
205
[ `std::error::Error` ] : https://doc.rust-lang.org/std/error/trait.Error.html
206
206
[ `error-chain` ] : https://docs.rs/error-chain
207
- [ `cause ()` ] : https://doc.rust-lang.org/std/error/trait.Error.html#method.cause
207
+ [ `source ()` ] : https://doc.rust-lang.org/std/error/trait.Error.html#method.source
208
208
209
209
Additionally, error types should implement the [ ` Send ` ] and [ ` Sync ` ] traits. An
210
210
error that is not ` Send ` cannot be returned by a thread run with
@@ -269,9 +269,8 @@ impl Error for DoError { /* ... */ }
269
269
The error message given by the ` Display ` representation of an error type should
270
270
be lowercase without trailing punctuation, and typically concise.
271
271
272
- The message given by [ ` Error::description() ` ] does not matter. Users should
273
- always use ` Display ` instead of ` description() ` to print the error. A low-effort
274
- description like ` "JSON error" ` is sufficient.
272
+ [ ` Error::description() ` ] should not be implemented. It has been deprecated and users should
273
+ always use ` Display ` instead of ` description() ` to print the error.
275
274
276
275
[ `Error::description()` ] : https://doc.rust-lang.org/std/error/trait.Error.html#tymethod.description
277
276
0 commit comments