mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
style: format
This commit is contained in:
+7
-14
@@ -242,15 +242,12 @@ pub struct FormattedReqwestError(reqwest::Error);
|
|||||||
|
|
||||||
impl std::ops::Deref for FormattedReqwestError {
|
impl std::ops::Deref for FormattedReqwestError {
|
||||||
type Target = reqwest::Error;
|
type Target = reqwest::Error;
|
||||||
fn deref(&self) -> &Self::Target {
|
|
||||||
&self.0
|
fn deref(&self) -> &Self::Target { &self.0 }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl std::error::Error for FormattedReqwestError {
|
impl std::error::Error for FormattedReqwestError {
|
||||||
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
|
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { self.0.source() }
|
||||||
self.0.source()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl std::fmt::Display for FormattedReqwestError {
|
impl std::fmt::Display for FormattedReqwestError {
|
||||||
@@ -260,9 +257,9 @@ impl std::fmt::Display for FormattedReqwestError {
|
|||||||
&& let Some(real_error) = hyper_error.source()
|
&& let Some(real_error) = hyper_error.source()
|
||||||
{
|
{
|
||||||
if let Some(real_reason) = real_error.source() {
|
if let Some(real_reason) = real_error.source() {
|
||||||
write!(f, "{}: {}", real_error, real_reason)
|
write!(f, "{real_error}: {real_reason}")
|
||||||
} else {
|
} else {
|
||||||
write!(f, "{}", real_error)
|
write!(f, "{real_error}")
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
write!(f, "Request error: {}", &self.0)
|
write!(f, "Request error: {}", &self.0)
|
||||||
@@ -271,13 +268,9 @@ impl std::fmt::Display for FormattedReqwestError {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl From<reqwest::Error> for FormattedReqwestError {
|
impl From<reqwest::Error> for FormattedReqwestError {
|
||||||
fn from(err: reqwest::Error) -> Self {
|
fn from(err: reqwest::Error) -> Self { Self(err) }
|
||||||
FormattedReqwestError(err)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<reqwest::Error> for Error {
|
impl From<reqwest::Error> for Error {
|
||||||
fn from(err: reqwest::Error) -> Self {
|
fn from(err: reqwest::Error) -> Self { Self::Reqwest(err.into()) }
|
||||||
Error::Reqwest(err.into())
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user