From faaeec330e42fe3c34b4e3abcaf24d12fdf0884c Mon Sep 17 00:00:00 2001 From: Adrian Valcarcel-Schott Date: Wed, 15 Nov 2023 09:31:09 -0500 Subject: [PATCH] feat: add trailing comma support (#45) --- src/macros.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/macros.rs b/src/macros.rs index 4a1d6cdd..a8928f5f 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -85,11 +85,11 @@ macro_rules! static_detour { // 6 — argument and return type (return/void) (@parse_prototype - ($($input:tt)*) | ($($argument_type:ty),*) -> $return_type:ty ; $($rest:tt)*) => { + ($($input:tt)*) | ($($argument_type:ty),* $(,)?) -> $return_type:ty ; $($rest:tt)*) => { $crate::static_detour!( @parse_terminator ($($input)* ($($argument_type)*) ($return_type)) | ; $($rest)*); }; - (@parse_prototype ($($input:tt)*) | ($($argument_type:ty),*) $($rest:tt)*) => { + (@parse_prototype ($($input:tt)*) | ($($argument_type:ty),* $(,)?) $($rest:tt)*) => { $crate::static_detour!(@parse_terminator ($($input)* ($($argument_type)*) (())) | $($rest)*); };