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

Delete deprecated Error::description implementation #237

Merged
merged 1 commit into from Feb 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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