mirror of
https://github.com/loot/loot-condition-interpreter.git
synced 2026-07-27 14:16:09 -07:00
Replace deprecated Error::cause with Error::source
Error::source was added in Rust 1.30.0, and Error::cause was deprecated in favour of it in Rust 1.33.0.
This commit is contained in:
+4
-4
@@ -63,7 +63,7 @@ impl fmt::Display for Error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl error::Error for Error {
|
impl error::Error for Error {
|
||||||
fn cause(&self) -> Option<&error::Error> {
|
fn source(&self) -> Option<&(dyn error::Error + 'static)> {
|
||||||
match self {
|
match self {
|
||||||
Error::ParsingError(_, e) => Some(e),
|
Error::ParsingError(_, e) => Some(e),
|
||||||
Error::PeParsingError(_, e) => Some(e.as_ref()),
|
Error::PeParsingError(_, e) => Some(e.as_ref()),
|
||||||
@@ -97,8 +97,8 @@ impl<I: fmt::Debug + fmt::Display> fmt::Display for ParsingError<I> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<I: fmt::Debug + fmt::Display> error::Error for ParsingError<I> {
|
impl<I: fmt::Debug + fmt::Display> error::Error for ParsingError<I> {
|
||||||
fn cause(&self) -> Option<&error::Error> {
|
fn source(&self) -> Option<&(dyn error::Error + 'static)> {
|
||||||
self.kind.cause()
|
self.kind.source()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -147,7 +147,7 @@ impl From<ParseIntError> for ParsingErrorKind {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl error::Error for ParsingErrorKind {
|
impl error::Error for ParsingErrorKind {
|
||||||
fn cause(&self) -> Option<&error::Error> {
|
fn source(&self) -> Option<&(dyn error::Error + 'static)> {
|
||||||
match self {
|
match self {
|
||||||
ParsingErrorKind::InvalidCrc(e) => Some(e),
|
ParsingErrorKind::InvalidCrc(e) => Some(e),
|
||||||
_ => None,
|
_ => None,
|
||||||
|
|||||||
Reference in New Issue
Block a user