diff options
author | 2018-06-21 12:19:54 +0200 | |
---|---|---|
committer | 2018-06-21 12:19:54 +0200 | |
commit | 31b90ccc657a5468de6bdffea8d309f502cd0d07 (patch) | |
tree | 5b5689f15dfb2cdcc27eca10ef39212dd18db4f2 /askama_shared/src/error.rs | |
parent | f05a924c49afb537b624cfe3cbef3a95b13759a2 (diff) | |
download | askama-31b90ccc657a5468de6bdffea8d309f502cd0d07.tar.gz askama-31b90ccc657a5468de6bdffea8d309f502cd0d07.tar.bz2 askama-31b90ccc657a5468de6bdffea8d309f502cd0d07.zip |
Fix formatting with cargo fmt
Diffstat (limited to 'askama_shared/src/error.rs')
-rw-r--r-- | askama_shared/src/error.rs | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/askama_shared/src/error.rs b/askama_shared/src/error.rs index cdd6b55..df175cd 100644 --- a/askama_shared/src/error.rs +++ b/askama_shared/src/error.rs @@ -1,5 +1,5 @@ +use std::error::Error as ErrorTrait; use std::fmt::{self, Display}; -use std::error::{Error as ErrorTrait}; pub type Result<I> = ::std::result::Result<I, Error>; @@ -23,7 +23,7 @@ pub type Result<I> = ::std::result::Result<I, Error>; /// bring to this crate are small, which is why /// `std::error::Error` was used. /// -#[derive(Debug, )] +#[derive(Debug)] pub enum Error { /// formatting error Fmt(fmt::Error), @@ -40,22 +40,21 @@ pub enum Error { } 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" + _ => "unknown error: __Nonexhaustive", } } fn cause(&self) -> Option<&ErrorTrait> { match *self { Error::Fmt(ref err) => err.cause(), - #[cfg(feature = "serde-json")] + #[cfg(feature = "serde-json")] Error::Json(ref err) => err.cause(), - _ => None + _ => None, } } } @@ -67,7 +66,7 @@ impl Display for Error { #[cfg(feature = "serde-json")] Error::Json(ref err) => write!(formatter, "json conversion error: {}", err), - _ => write!(formatter, "unknown error: __Nonexhaustive") + _ => write!(formatter, "unknown error: __Nonexhaustive"), } } } @@ -85,11 +84,10 @@ impl From<::serde_json::Error> for Error { } } - #[cfg(test)] mod tests { use super::Error; trait AssertSendSyncStatic: Send + Sync + 'static {} impl AssertSendSyncStatic for Error {} -}
\ No newline at end of file +} |