From 75ab435dacbb3dd9ea3d7791e0226046bc2b8bef Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Fri, 23 May 2014 19:26:20 +0400 Subject: [PATCH] Made impl_raw_constructors more general --- src/sdl2/macros.rs | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/sdl2/macros.rs b/src/sdl2/macros.rs index 61221ffd..c78d760e 100644 --- a/src/sdl2/macros.rs +++ b/src/sdl2/macros.rs @@ -23,22 +23,12 @@ macro_rules! impl_owned_accessors( ) macro_rules! impl_raw_constructor( - ($($t:ty -> $te:ident ($r:ident:$rt:ty));+) => ( + ($($t:ty -> $te:ident ($($r:ident:$rt:ty),+));+) => ( $( impl $t { #[inline] - pub unsafe fn new_from_raw($r:$rt) -> $t { - $te { $r: $r } - } - } - )+ - ); - ($($t:ty -> $te:ident ($r:ident:$rt:ty, $o:ident:$ot:ty));+) => ( - $( - impl $t { - #[inline] - pub unsafe fn new_from_raw($r:$rt, $o:$ot) -> $t { - $te { $r: $r, $o: $o } + pub unsafe fn new_from_raw($($r:$rt),+) -> $t { + $te { $($r: $r),+ } } } )+