diff --git a/Cargo.lock b/Cargo.lock index e1e506b..58a682f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -183,7 +183,7 @@ dependencies = [ [[package]] name = "actix-web-utils" -version = "0.2.8" +version = "0.2.9" dependencies = [ "actix-web", "log", diff --git a/Cargo.toml b/Cargo.toml index 9f3f14c..3849d9e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "actix-web-utils" -version = "0.2.8" +version = "0.2.9" edition = "2021" authors = ["Franklin E. Blanco"] description = "Just some useful addons for actix web." diff --git a/src/traits/macro_traits.rs b/src/traits/macro_traits.rs index 28d4029..b855bd3 100644 --- a/src/traits/macro_traits.rs +++ b/src/traits/macro_traits.rs @@ -1,6 +1,4 @@ use std::fmt::Display; - -use log::debug; use serde::Serialize; use crate::{dtos::message::MessageResource, enums::error::Error, extensions::typed_response::TypedHttpResponse}; @@ -17,7 +15,7 @@ impl ReturnableErrorShape for MessageResource { } impl ReturnableErrorShape for Error { fn convert_to_returnable(&self, status_code: u16) -> TypedHttpResponse { - debug!("Converted error to returnable. Error: {}", self.to_string()); + //debug!("Converted error to returnable. Error: {}", self.to_string()); match self { Error::Unspecified => TypedHttpResponse::return_standard_error(status_code, MessageResource::new_empty()), Error::NetworkError(message) => TypedHttpResponse::return_standard_error(status_code, message.clone()), @@ -34,7 +32,7 @@ impl ReturnableErrorShape for Vec { TypedHttpResponse::return_standard_error_list(status_code, self.to_vec()) } } -impl ReturnableErrorShape for dyn Display { +impl<'a> ReturnableErrorShape for dyn Display + 'a { fn convert_to_returnable(&self, status_code: u16) -> TypedHttpResponse { TypedHttpResponse::return_standard_error(status_code, MessageResource::new_from_err(self)) }