diff --git a/src/macros.rs b/src/macros.rs index 5ddb7f9..bbc9ef8 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -1,23 +1,27 @@ macro_rules! derive_free { - ($object_type:ident) => { - $crate::macros::wrap_method!($object_type; - #[doc = concat!("Deallocates a [`", stringify!($object_type), "`] instance.")] - #[allow(dropping_copy_types)] - fn free(move instance) { - ::std::mem::drop(instance) - }; - ); + ($typ:ident) => { + ::paste::paste! { + $crate::macros::wrap_method!($typ; + #[doc = "Deallocates a [`" $typ "`] instance."] + #[allow(dropping_copy_types)] + fn free(move instance) { + ::std::mem::drop(instance) + }; + ); + } }; } macro_rules! derive_clone { ($object_type:ident) => { - $crate::macros::wrap_method!($object_type; - #[doc = concat!("Clones a [`", stringify!($object_type), "`] instance.")] - fn clone(ref instance) -> move ::core::ptr::NonNull<$object_type> { - instance.clone() - }; - ); + ::paste::paste! { + $crate::macros::wrap_method!($object_type; + #[doc = "Clones a [`" $object_type "`] instance."] + fn clone(ref instance) -> move ::core::ptr::NonNull<$object_type> { + instance.clone() + }; + ); + } }; } @@ -265,7 +269,7 @@ macro_rules! wrap { $( derives: $( - $derive:path $( [ $( $derive_arg:tt ),+ ] )? + $derive:path $( [ $( $derive_arg:ident ),+ ] )? ),+; )? $(