diff options
| author | Fuwn <[email protected]> | 2022-06-08 20:02:34 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2022-06-08 20:02:34 -0700 |
| commit | 51c924e6f36a999cc655715e4e6b4cb30e247e6b (patch) | |
| tree | 058f9ff6b3b718ca2429ebde466d8030d86d1853 /src | |
| parent | feat(robots): dynamic robots.txt module (diff) | |
| download | locus-51c924e6f36a999cc655715e4e6b4cb30e247e6b.tar.xz locus-51c924e6f36a999cc655715e4e6b4cb30e247e6b.zip | |
feat(macros): allow trailing comma
Diffstat (limited to 'src')
| -rw-r--r-- | src/macros.rs | 6 | ||||
| -rw-r--r-- | src/modules/mod.rs | 6 |
2 files changed, 5 insertions, 7 deletions
diff --git a/src/macros.rs b/src/macros.rs index 3ac6463..492a38a 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -96,12 +96,12 @@ macro_rules! mount_file { #[macro_export] macro_rules! batch_mount { - ("pages", $router:ident, $(($path:literal, $description:literal, $file:literal),)*) => { + ("pages", $router:ident, $(($path:literal, $description:literal, $file:literal)),* $(,)?) => { $( $crate::mount_page!($router, $path, $description, $file); )* }; - ("files", $router:ident, $(($path:literal, $description:literal, $file:literal),)*) => { + ("files", $router:ident, $(($path:literal, $description:literal, $file:literal)),* $(,)?) => { $( $crate::mount_file!($router, $path, $description, $file); )* @@ -117,7 +117,7 @@ macro_rules! stateless { #[macro_export] macro_rules! statelesses { - ($router:ident, $($module:tt),*) => { + ($router:ident, $($module:tt),* $(,)?) => { $($crate::stateless!($router, $module);)* }; } diff --git a/src/modules/mod.rs b/src/modules/mod.rs index 544c366..4b67961 100644 --- a/src/modules/mod.rs +++ b/src/modules/mod.rs @@ -16,8 +16,6 @@ // Copyright (C) 2022-2022 Fuwn <[email protected]> // SPDX-License-Identifier: GPL-3.0-only -use crate::statelesses; - mod multi_blog; mod random; mod remarks; @@ -29,8 +27,8 @@ mod r#static; mod uptime; pub fn module(router: &mut windmark::Router) { - statelesses!( + crate::statelesses!( router, uptime, sitemap, search, remarks, multi_blog, random, r#static, - router, robots + router, robots, ); } |