Browse Source

Fix to avoid needing the extra curly braces

Getty Ritter 4 years ago
parent
commit
d8f011ccc3
1 changed files with 3 additions and 4 deletions
  1. 3 4
      src/lib.rs

+ 3 - 4
src/lib.rs

@@ -1,12 +1,12 @@
 #[macro_export]
 macro_rules! system {
-    ($name:ident $pat:tt => $block:block ) => {
+    ($name:ident $pat:tt => $($rest:tt)* ) => {
         struct $name;
         impl<'a> specs::System<'a> for $name {
             type SystemData = args_to_systemdata!($pat);
             fn run(&mut self, args_to_pat!($pat): Self::SystemData) {
                 for args_to_pat!($pat) in args_to_join!($pat).join() {
-                    $block
+                    $($rest)*
                 }
             }
         }
@@ -77,8 +77,7 @@ mod tests {
         type Storage = specs::VecStorage<Mov>;
     }
 
-    system!{ Foo (_x: Mov, mut y: Pos) => {
+    system!{ Foo (_x: Mov, mut y: Pos) =>
         y.x += 1;
     }
-    }
 }