Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
}
}
}
2 changes: 0 additions & 2 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,6 @@ impl ClientBuilder {
self
}

#[allow(clippy::result_large_err)]
pub fn build(self) -> Result<Client> {
let session = self.session.build()?;
let max_attempt = self.max_attempt;
Expand Down Expand Up @@ -665,7 +664,6 @@ impl Client {
}

#[cfg(feature = "spooling")]
#[allow(clippy::result_large_err)]
fn decode_segments<T: Trino + 'static>(
&self,
encoding: &str,
Expand Down
9 changes: 7 additions & 2 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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<reqwest::Error>),
#[error("http not ok, code: {0}, reason: {1}")]
HttpNotOk(StatusCode, String),
#[error("query error, reason: {0}")]
Expand All @@ -56,6 +55,12 @@ pub enum Error {
InternalError(String),
}

impl From<reqwest::Error> for Error {
fn from(err: reqwest::Error) -> Self {
Error::HttpError(Box::new(err))
}
}

impl From<QueryError> for Error {
fn from(err: QueryError) -> Self {
Error::QueryError(Box::new(err))
Expand Down
1 change: 0 additions & 1 deletion src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ impl SessionBuilder {
}
}

#[allow(clippy::result_large_err)]
pub fn build(self) -> Result<Session> {
let scheme = if self.secure {
Scheme::HTTPS
Expand Down
3 changes: 0 additions & 3 deletions src/ssl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ impl Default for Ssl {
}

impl Ssl {
#[allow(clippy::result_large_err)]
pub fn read_pem<P: AsRef<Path>>(root_certificate_path: &P) -> Result<Certificate> {
let buf = Self::read_file(&root_certificate_path)?;
match reqwest::Certificate::from_pem(&buf) {
Expand All @@ -29,7 +28,6 @@ impl Ssl {
}
}

#[allow(clippy::result_large_err)]
pub fn read_der<P: AsRef<Path>>(root_certificate_path: &P) -> Result<Certificate> {
let buf = Self::read_file(&root_certificate_path)?;
match reqwest::Certificate::from_der(&buf) {
Expand All @@ -41,7 +39,6 @@ impl Ssl {
}
}

#[allow(clippy::result_large_err)]
fn read_file<P: AsRef<Path>>(file_path: &P) -> Result<Vec<u8>> {
let mut buf = Vec::new();
std::fs::File::open(file_path)
Expand Down
Loading