From 6a2aef34368127c8a2bf85e274242b0d9244c442 Mon Sep 17 00:00:00 2001 From: Franklin Date: Wed, 31 Aug 2022 13:10:10 -0400 Subject: [PATCH] Fixed macro bug --- Cargo.lock | 2 +- Cargo.toml | 4 +++- src/utils/macros.rs | 6 +++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4f31207..298a951 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -183,7 +183,7 @@ dependencies = [ [[package]] name = "actix-web-utils" -version = "0.2.4" +version = "0.2.5" dependencies = [ "actix-web", "log", diff --git a/Cargo.toml b/Cargo.toml index 04399cd..5677039 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,10 +1,12 @@ [package] name = "actix-web-utils" -version = "0.2.4" +version = "0.2.5" edition = "2021" authors = ["Franklin E. Blanco"] description = "Just some useful addons for actix web." license = "MIT" +readme = "README.md" +repository = "https://github.com/franklinblanco/actix-web-utils" [lib] diff --git a/src/utils/macros.rs b/src/utils/macros.rs index 579ec43..748bc64 100644 --- a/src/utils/macros.rs +++ b/src/utils/macros.rs @@ -10,19 +10,19 @@ macro_rules! unwrap_or_return_handled_error { ( $e:expr ) => { match $e { Ok(value) => value, - Err(error) => return actix_web_utils::traits::macro_traits::ReturnableErrorShape::convert_to_returnable(error, 500) + Err(error) => return actix_web_utils::traits::macro_traits::ReturnableErrorShape::convert_to_returnable(&error, 500) } }; ( $error_status_code:literal, $e:expr ) => { match $e { Ok(value) => value, - Err(error) => return actix_web_utils::traits::macro_traits::ReturnableErrorShape::convert_to_returnable(error, error_status_code) + Err(error) => return actix_web_utils::traits::macro_traits::ReturnableErrorShape::convert_to_returnable(&error, error_status_code) } }; ( $error_status_code:literal, $success_status_code:literal, $e:expr) => { match $e { Ok(value) => return actix_web_utils::typed_response::TypedHttpResponse::return_standard_response($success_status_code, value), - Err(error) => return actix_web_utils::traits::macro_traits::ReturnableErrorShape::convert_to_returnable(error, error_status_code) + Err(error) => return actix_web_utils::traits::macro_traits::ReturnableErrorShape::convert_to_returnable(&error, error_status_code) } } } \ No newline at end of file