From c573f1ea806a44b89b3e4b84e02b68f838f1279b Mon Sep 17 00:00:00 2001 From: Fuwn Date: Wed, 20 Apr 2022 00:18:23 -0700 Subject: refactor(macros): batch_mount files --- src/macros.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/macros.rs') diff --git a/src/macros.rs b/src/macros.rs index ce2c403..025e0dc 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -84,10 +84,15 @@ macro_rules! mount_file { } #[macro_export] -macro_rules! batch_mount_page { - ($router:ident,$(($path:literal, $description:literal, $file:literal),)*) => { +macro_rules! batch_mount { + ("pages", $router:ident, $(($path:literal, $description:literal, $file:literal),)*) => { $( mount_page!($router, $path, $description, $file); )* }; + ("files", $router:ident, $(($path:literal, $description:literal, $file:literal),)*) => { + $( + mount_file!($router, $path, $description, $file); + )* + }; } -- cgit v1.2.3