diff options
| author | Fuwn <[email protected]> | 2022-04-20 00:18:23 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2022-04-20 00:18:23 -0700 |
| commit | c573f1ea806a44b89b3e4b84e02b68f838f1279b (patch) | |
| tree | b4bf0960b16dc6fb4c89bb0cf14713d40cc1f1e8 /src/macros.rs | |
| parent | fix(macros): rename macro to page (diff) | |
| download | locus-c573f1ea806a44b89b3e4b84e02b68f838f1279b.tar.xz locus-c573f1ea806a44b89b3e4b84e02b68f838f1279b.zip | |
refactor(macros): batch_mount files
Diffstat (limited to 'src/macros.rs')
| -rw-r--r-- | src/macros.rs | 9 |
1 files changed, 7 insertions, 2 deletions
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); + )* + }; } |