From 8050cfcd70a16273cc2814fe29c8ee08320d85d3 Mon Sep 17 00:00:00 2001 From: fxqnlr Date: Thu, 20 Apr 2023 15:13:58 +0200 Subject: cargo fmt --- src/error.rs | 37 +++++++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 8 deletions(-) (limited to 'src/error.rs') diff --git a/src/error.rs b/src/error.rs index 794a919..bd6e3da 100644 --- a/src/error.rs +++ b/src/error.rs @@ -43,49 +43,70 @@ impl fmt::Display for MLError { ErrorType::LibReq => write!(f, "REQWEST"), ErrorType::LibChrono => write!(f, "Chrono error: {}", self.message), ErrorType::IoError => write!(f, "IO"), - ErrorType::Other => write!(f, "OTHER") + ErrorType::Other => write!(f, "OTHER"), } } } impl From for MLError { fn from(error: reqwest::Error) -> Self { - Self { etype: ErrorType::LibReq, message: error.to_string() } + Self { + etype: ErrorType::LibReq, + message: error.to_string(), + } } } impl From for MLError { fn from(error: toml::de::Error) -> Self { - Self { etype: ErrorType::LibToml, message: error.to_string() } + Self { + etype: ErrorType::LibToml, + message: error.to_string(), + } } } impl From for MLError { fn from(error: rusqlite::Error) -> Self { - Self { etype: ErrorType::LibSql, message: error.to_string() } + Self { + etype: ErrorType::LibSql, + message: error.to_string(), + } } } impl From for MLError { fn from(error: toml::ser::Error) -> Self { - Self { etype: ErrorType::LibToml, message: error.to_string() } + Self { + etype: ErrorType::LibToml, + message: error.to_string(), + } } } impl From for MLError { fn from(error: chrono::ParseError) -> Self { - Self { etype: ErrorType::LibChrono, message: error.to_string() } + Self { + etype: ErrorType::LibChrono, + message: error.to_string(), + } } } impl From for MLError { fn from(error: std::io::Error) -> Self { - Self { etype: ErrorType::IoError, message: error.to_string() } + Self { + etype: ErrorType::IoError, + message: error.to_string(), + } } } impl MLError { pub fn new(etype: ErrorType, message: &str) -> Self { - Self { etype, message: String::from(message) } + Self { + etype, + message: String::from(message), + } } } -- cgit v1.2.3