From e2687011eb5f03f8ee01ac4e765dc3c8ed52ec95 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Wed, 18 Dec 2024 16:07:18 +0100 Subject: [PATCH] `utils`: Allow zero templates and routes --- acrate_utils/src/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/acrate_utils/src/lib.rs b/acrate_utils/src/lib.rs index 1187539..1da26e8 100644 --- a/acrate_utils/src/lib.rs +++ b/acrate_utils/src/lib.rs @@ -29,10 +29,10 @@ macro_rules! web_server { ( on: $socket_addr:expr, templates: [ - $( $template_path:literal ),+ + $( $template_path:literal ),* ], routes: { - $( $path:literal => $route:expr ),+ + $( $path:literal => $route:expr ),* } ) => { $crate::init::init_logging(); @@ -40,11 +40,11 @@ macro_rules! web_server { let mut mj = $crate::init::init_minijinja(); $( $crate::add_minijinja_template!(mj, $template_path); - )+ + )* let router = $crate::init::init_router(mj); $( $crate::add_axum_route!(router, $path, $route); - )+ + )* $crate::run::run_server(listener, router).await }; }