From 58a33c9b26be0cd25cc39d6421eb6e6491c27865 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Wed, 29 Jan 2020 09:15:53 +0100 Subject: Error::description() will be deprecated soon --- askama_shared/src/error.rs | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'askama_shared/src') diff --git a/askama_shared/src/error.rs b/askama_shared/src/error.rs index f3e8b48..4d0fad9 100644 --- a/askama_shared/src/error.rs +++ b/askama_shared/src/error.rs @@ -1,4 +1,3 @@ -use std::error::Error as ErrorTrait; use std::fmt::{self, Display}; pub type Result = ::std::result::Result; @@ -43,17 +42,8 @@ pub enum Error { __Nonexhaustive, } -impl ErrorTrait for Error { - fn description(&self) -> &str { - match *self { - Error::Fmt(ref err) => err.description(), - #[cfg(feature = "serde_json")] - Error::Json(ref err) => err.description(), - _ => "unknown error: __Nonexhaustive", - } - } - - fn cause(&self) -> Option<&dyn ErrorTrait> { +impl std::error::Error for Error { + fn cause(&self) -> Option<&dyn std::error::Error> { match *self { Error::Fmt(ref err) => err.source(), #[cfg(feature = "serde_json")] -- cgit