Skip to content

Commit

Permalink
Changed impl Error::cause() to Error::source()
Browse files Browse the repository at this point in the history
This implements `source()` method instead of `cause()` allowing
downcasting.
  • Loading branch information
Kixunil committed Jun 10, 2022
1 parent 31bb35a commit ca110b8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/lib.rs
Expand Up @@ -377,8 +377,7 @@ impl fmt::Display for Error {
#[cfg(feature = "std")]
#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
impl std::error::Error for Error {
#[allow(deprecated)]
fn cause(&self) -> Option<&dyn std::error::Error> {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match self {
Error::IncorrectSignature => None,
Error::InvalidMessage => None,
Expand Down

0 comments on commit ca110b8

Please sign in to comment.