Another attempt to fix macros
This commit is contained in:
parent
92beac9893
commit
b80c9b47fc
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -183,7 +183,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "actix-web-utils"
|
name = "actix-web-utils"
|
||||||
version = "0.2.6"
|
version = "0.2.7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"actix-web",
|
"actix-web",
|
||||||
"log",
|
"log",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "actix-web-utils"
|
name = "actix-web-utils"
|
||||||
version = "0.2.6"
|
version = "0.2.7"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
authors = ["Franklin E. Blanco"]
|
authors = ["Franklin E. Blanco"]
|
||||||
description = "Just some useful addons for actix web."
|
description = "Just some useful addons for actix web."
|
||||||
|
@ -10,19 +10,19 @@ macro_rules! unwrap_or_return_handled_error {
|
|||||||
( $e:expr, $type_of_resp:ty ) => {
|
( $e:expr, $type_of_resp:ty ) => {
|
||||||
match $e {
|
match $e {
|
||||||
Ok(value) => value,
|
Ok(value) => value,
|
||||||
Err(error) => return actix_web_utils::traits::macro_traits::ReturnableErrorShape::convert_to_returnable::<$type_of_resp>::(&error, 500)
|
Err(error) => return actix_web_utils::traits::macro_traits::ReturnableErrorShape::convert_to_returnable::<$type_of_resp>(&error, 500)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
( $error_status_code:literal, $e:expr, $type_of_resp:ty ) => {
|
( $error_status_code:literal, $e:expr, $type_of_resp:ty ) => {
|
||||||
match $e {
|
match $e {
|
||||||
Ok(value) => value,
|
Ok(value) => value,
|
||||||
Err(error) => return actix_web_utils::traits::macro_traits::ReturnableErrorShape::convert_to_returnable::<$type_of_resp>::(&error, error_status_code)
|
Err(error) => return actix_web_utils::traits::macro_traits::ReturnableErrorShape::convert_to_returnable::<$type_of_resp>(&error, error_status_code)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
( $error_status_code:literal, $success_status_code:literal, $e:expr, $type_of_resp:ty) => {
|
( $error_status_code:literal, $success_status_code:literal, $e:expr, $type_of_resp:ty) => {
|
||||||
match $e {
|
match $e {
|
||||||
Ok(value) => return actix_web_utils::typed_response::TypedHttpResponse::return_standard_response($success_status_code, value),
|
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::<$type_of_resp>::(&error, error_status_code)
|
Err(error) => return actix_web_utils::traits::macro_traits::ReturnableErrorShape::convert_to_returnable::<$type_of_resp>(&error, error_status_code)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user