Skip to content

Commit

Permalink
Add support for trailing commas in the macros
Browse files Browse the repository at this point in the history
This affects the macros `benchmark_group!` and `benchmark_main!`.
  • Loading branch information
tbu- committed Dec 31, 2017
1 parent 19ff225 commit 46a426a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ macro_rules! benchmark_group {
)+
benches
}
}
};
($group_name:ident, $($function:path,)+) => {
benchmark_group!($group_name, $($function),+);
};
}


Expand All @@ -45,5 +48,8 @@ macro_rules! benchmark_main {
)+
run_tests_console(&test_opts, benches).unwrap();
}
}
};
($($group_name:path,)+) => {
benchmark_main!($($group_name),+);
};
}

0 comments on commit 46a426a

Please sign in to comment.