diff options
| author | Fuwn <[email protected]> | 2023-05-05 01:33:55 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2023-05-05 01:33:55 +0000 |
| commit | d66da17c17239408f2ddbc2794621e2d947056a3 (patch) | |
| tree | e448da50c46c429f6ca672aa070577766fffc9bc /src/response | |
| parent | docs(rossweisse): revert to implementation (diff) | |
| download | windmark-d66da17c17239408f2ddbc2794621e2d947056a3.tar.xz windmark-d66da17c17239408f2ddbc2794621e2d947056a3.zip | |
feat(windmark): prelude feature flag
Diffstat (limited to 'src/response')
| -rw-r--r-- | src/response/macros.rs | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/src/response/macros.rs b/src/response/macros.rs index 9f78c41..976973b 100644 --- a/src/response/macros.rs +++ b/src/response/macros.rs @@ -22,10 +22,10 @@ macro_rules! sync_response { #[macro_export] macro_rules! $name { ($body:expr /* $(,)? */) => { - |_: $crate::context::RouteContext| $crate::Response::$name($body) + |_: $crate::context::RouteContext| $crate::response::Response::$name($body) }; ($context:ident, $body:expr /* $(,)? */) => { - |$context: $crate::context::RouteContext| $crate::Response::$name($body) + |$context: $crate::context::RouteContext| $crate::response::Response::$name($body) }; } )* @@ -39,10 +39,10 @@ macro_rules! async_response { #[macro_export] macro_rules! [< $name _async >] { ($body:expr /* $(,)? */) => { - |_: $crate::context::RouteContext| async { $crate::Response::$name($body) } + |_: $crate::context::RouteContext| async { $crate::response::Response::$name($body) } }; ($context:ident, $body:expr /* $(,)? */) => { - |$context: $crate::context::RouteContext| async { $crate::Response::$name($body) } + |$context: $crate::context::RouteContext| async { $crate::response::Response::$name($body) } }; } })* @@ -86,7 +86,7 @@ response!(binary_success_auto); macro_rules! binary_success { ($body:expr, $mime:expr) => { |_: $crate::context::RouteContext| { - $crate::Response::binary_success($body, $mime) + $crate::response::Response::binary_success($body, $mime) } }; ($body:expr) => {{ @@ -98,16 +98,19 @@ macro_rules! binary_success { |_: $crate::context::RouteContext| { #[cfg(feature = "auto-deduce-mime")] - return $crate::Response::binary_success_auto($body); + return $crate::response::Response::binary_success_auto($body); // Suppress item not found warning #[cfg(not(feature = "auto-deduce-mime"))] - $crate::Response::binary_success($body, "application/octet-stream") + $crate::response::Response::binary_success( + $body, + "application/octet-stream", + ) } }}; ($context:ident, $body:expr, $mime:expr) => { |$context: $crate::context::RouteContext| { - $crate::Response::binary_success($body, $mime) + $crate::response::Response::binary_success($body, $mime) } }; ($context:ident, $body:expr) => {{ @@ -119,11 +122,14 @@ macro_rules! binary_success { |$context: $crate::context::RouteContext| { #[cfg(feature = "auto-deduce-mime")] - return $crate::Response::binary_success_auto($body); + return $crate::response::Response::binary_success_auto($body); // Suppress item not found warning #[cfg(not(feature = "auto-deduce-mime"))] - $crate::Response::binary_success($body, "application/octet-stream") + $crate::response::Response::binary_success( + $body, + "application/octet-stream", + ) } }}; } |