Skip to content

Commit df081be

Browse files
committed
Changed impl Error::cause() to Error::source()
This implements `source()` method instead of `cause()` allowing downcasting.
1 parent cabb8f9 commit df081be

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,8 +377,7 @@ impl fmt::Display for Error {
377377
#[cfg(feature = "std")]
378378
#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
379379
impl std::error::Error for Error {
380-
#[allow(deprecated)]
381-
fn cause(&self) -> Option<&dyn std::error::Error> {
380+
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
382381
match self {
383382
Error::IncorrectSignature => None,
384383
Error::InvalidMessage => None,

0 commit comments

Comments
 (0)