Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Commit

Permalink
Merge pull request #237 from dtolnay/description
Browse files Browse the repository at this point in the history
Delete deprecated Error::description implementation
  • Loading branch information
dtolnay committed Feb 21, 2022
2 parents f4a9530 + 8b8503d commit a14e026
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions src/error.rs
Expand Up @@ -159,10 +159,6 @@ impl Error {
}

impl error::Error for Error {
fn description(&self) -> &str {
self.0.description()
}

fn source(&self) -> Option<&(dyn error::Error + 'static)> {
self.0.source()
}
Expand Down Expand Up @@ -195,24 +191,6 @@ impl de::Error for Error {
}

impl ErrorImpl {
#[allow(deprecated)]
fn description(&self) -> &str {
match self {
ErrorImpl::Message(msg, _) => msg,
ErrorImpl::Emit(_) => "emit error",
ErrorImpl::Scan(_) => "scan error",
ErrorImpl::Io(err) => error::Error::description(err),
ErrorImpl::Utf8(err) => error::Error::description(err),
ErrorImpl::FromUtf8(err) => error::Error::description(err),
ErrorImpl::EndOfStream => "EOF while parsing a value",
ErrorImpl::MoreThanOneDocument => {
"deserializing from YAML containing more than one document is not supported"
}
ErrorImpl::RecursionLimitExceeded => "recursion limit exceeded",
ErrorImpl::Shared(err) => err.description(),
}
}

fn source(&self) -> Option<&(dyn error::Error + 'static)> {
match self {
ErrorImpl::Scan(err) => Some(err),
Expand Down

0 comments on commit a14e026

Please sign in to comment.