After rustfmt

This commit is contained in:
Dominik Werder
2021-04-16 14:43:21 +02:00
parent 1150bb3c55
commit 3afcddb1c7
16 changed files with 951 additions and 832 deletions

View File

@@ -7,17 +7,13 @@ pub struct Error {
impl Error {
pub fn with_msg<S: Into<String>>(s: S) -> Self {
Self {
msg: s.into(),
}
Self { msg: s.into() }
}
}
impl From<String> for Error {
fn from(k: String) -> Self {
Self {
msg: k,
}
Self { msg: k }
}
}
@@ -27,61 +23,46 @@ impl std::fmt::Display for Error {
}
}
impl std::error::Error for Error {
}
impl std::error::Error for Error {}
impl From<std::io::Error> for Error {
fn from (k: std::io::Error) -> Self {
Self {
msg: k.to_string(),
}
fn from(k: std::io::Error) -> Self {
Self { msg: k.to_string() }
}
}
impl From<http::Error> for Error {
fn from (k: http::Error) -> Self {
Self {
msg: k.to_string(),
}
fn from(k: http::Error) -> Self {
Self { msg: k.to_string() }
}
}
impl From<hyper::Error> for Error {
fn from (k: hyper::Error) -> Self {
Self {
msg: k.to_string(),
}
fn from(k: hyper::Error) -> Self {
Self { msg: k.to_string() }
}
}
impl From<serde_json::Error> for Error {
fn from (k: serde_json::Error) -> Self {
Self {
msg: k.to_string(),
}
fn from(k: serde_json::Error) -> Self {
Self { msg: k.to_string() }
}
}
impl From<async_channel::RecvError> for Error {
fn from (k: async_channel::RecvError) -> Self {
Self {
msg: k.to_string(),
}
fn from(k: async_channel::RecvError) -> Self {
Self { msg: k.to_string() }
}
}
impl From<chrono::format::ParseError> for Error {
fn from (k: chrono::format::ParseError) -> Self {
Self {
msg: k.to_string(),
}
fn from(k: chrono::format::ParseError) -> Self {
Self { msg: k.to_string() }
}
}
impl From<ParseIntError> for Error {
fn from (k: ParseIntError) -> Self {
Self {
msg: k.to_string(),
}
fn from(k: ParseIntError) -> Self {
Self { msg: k.to_string() }
}
}