aboutsummaryrefslogtreecommitdiffstats
path: root/askama_shared
diff options
context:
space:
mode:
authorLibravatar René Kijewski <kijewski@library.vetmed.fu-berlin.de>2022-03-28 16:44:03 +0200
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2022-03-28 16:53:40 +0200
commit799495b847727536da0dd51466a67f40c9eb5b0a (patch)
tree1bdce617971d4ce7e9a23a903f4531f9fd7bd4e7 /askama_shared
parent07e29c7e3d6df7e21ebabd0cdff0fa23cf380e34 (diff)
downloadaskama-799495b847727536da0dd51466a67f40c9eb5b0a.tar.gz
askama-799495b847727536da0dd51466a67f40c9eb5b0a.tar.bz2
askama-799495b847727536da0dd51466a67f40c9eb5b0a.zip
Implement std::error::Error::source
Error::cause() is deprecated since Rust 1.33.
Diffstat (limited to '')
-rw-r--r--askama_shared/src/error.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/askama_shared/src/error.rs b/askama_shared/src/error.rs
index 98f2703..7c959a6 100644
--- a/askama_shared/src/error.rs
+++ b/askama_shared/src/error.rs
@@ -41,14 +41,14 @@ pub enum Error {
}
impl std::error::Error for Error {
- fn cause(&self) -> Option<&dyn std::error::Error> {
+ fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match *self {
- Error::Fmt(ref err) => err.source(),
+ Error::Fmt(ref err) => Some(err),
Error::Custom(ref err) => Some(err.as_ref()),
#[cfg(feature = "serde_json")]
- Error::Json(ref err) => err.source(),
+ Error::Json(ref err) => Some(err),
#[cfg(feature = "serde_yaml")]
- Error::Yaml(ref err) => err.source(),
+ Error::Yaml(ref err) => Some(err),
}
}
}