diff --git a/src/auth.rs b/src/auth.rs index 2b96ded..365931b 100644 --- a/src/auth.rs +++ b/src/auth.rs @@ -25,7 +25,7 @@ impl fmt::Debug for Auth { .field("password", &"******") .finish(), - Auth::Jwt(token) => f.debug_struct("JwtAuth").field("token", token).finish(), + Auth::Jwt(_) => f.debug_struct("JwtAuth").field("token", &"******").finish(), } } } diff --git a/src/client.rs b/src/client.rs index 07a1ec1..29c0a03 100644 --- a/src/client.rs +++ b/src/client.rs @@ -247,7 +247,6 @@ impl ClientBuilder { self } - #[allow(clippy::result_large_err)] pub fn build(self) -> Result { let session = self.session.build()?; let max_attempt = self.max_attempt; @@ -665,7 +664,6 @@ impl Client { } #[cfg(feature = "spooling")] - #[allow(clippy::result_large_err)] fn decode_segments( &self, encoding: &str, diff --git a/src/error.rs b/src/error.rs index db1a794..9e3617c 100644 --- a/src/error.rs +++ b/src/error.rs @@ -6,7 +6,6 @@ use thiserror::Error; use crate::models::QueryError; #[derive(Error, Debug)] -#[allow(clippy::result_large_err)] pub enum Error { #[error("invalid catalog")] InvalidCatalog, @@ -39,7 +38,7 @@ pub enum Error { #[error("basic auth can not be used with http")] BasicAuthWithHttp, #[error("http error, reason: {0}")] - HttpError(#[from] reqwest::Error), + HttpError(#[source] Box), #[error("http not ok, code: {0}, reason: {1}")] HttpNotOk(StatusCode, String), #[error("query error, reason: {0}")] @@ -56,6 +55,12 @@ pub enum Error { InternalError(String), } +impl From for Error { + fn from(err: reqwest::Error) -> Self { + Error::HttpError(Box::new(err)) + } +} + impl From for Error { fn from(err: QueryError) -> Self { Error::QueryError(Box::new(err)) diff --git a/src/session.rs b/src/session.rs index b6af2b6..2ff18e1 100644 --- a/src/session.rs +++ b/src/session.rs @@ -92,7 +92,6 @@ impl SessionBuilder { } } - #[allow(clippy::result_large_err)] pub fn build(self) -> Result { let scheme = if self.secure { Scheme::HTTPS diff --git a/src/ssl.rs b/src/ssl.rs index 5adff68..1f2a0c5 100644 --- a/src/ssl.rs +++ b/src/ssl.rs @@ -17,7 +17,6 @@ impl Default for Ssl { } impl Ssl { - #[allow(clippy::result_large_err)] pub fn read_pem>(root_certificate_path: &P) -> Result { let buf = Self::read_file(&root_certificate_path)?; match reqwest::Certificate::from_pem(&buf) { @@ -29,7 +28,6 @@ impl Ssl { } } - #[allow(clippy::result_large_err)] pub fn read_der>(root_certificate_path: &P) -> Result { let buf = Self::read_file(&root_certificate_path)?; match reqwest::Certificate::from_der(&buf) { @@ -41,7 +39,6 @@ impl Ssl { } } - #[allow(clippy::result_large_err)] fn read_file>(file_path: &P) -> Result> { let mut buf = Vec::new(); std::fs::File::open(file_path)