After rustfmt
This commit is contained in:
@@ -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() }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user