Compare commits

..

1 commit

Author SHA1 Message Date
Vinzenz Schroeter 363609c663 add derives
Some checks failed
Rust / build-gnu-apt (pull_request) Successful in 2m5s
Rust / build-size-gnu-unstable (pull_request) Failing after 2m48s
2025-06-27 00:17:55 +02:00

View file

@ -1,27 +1,23 @@
macro_rules! derive_free {
($typ:ident) => {
::paste::paste! {
$crate::macros::wrap_method!($typ;
#[doc = "Deallocates a [`" $typ "`] instance."]
($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)
};
);
}
};
}
macro_rules! derive_clone {
($object_type:ident) => {
::paste::paste! {
$crate::macros::wrap_method!($object_type;
#[doc = "Clones a [`" $object_type "`] instance."]
#[doc = concat!("Clones a [`", stringify!($object_type), "`] instance.")]
fn clone(ref instance) -> move ::core::ptr::NonNull<$object_type> {
instance.clone()
};
);
}
};
}
@ -269,7 +265,7 @@ macro_rules! wrap {
$(
derives:
$(
$derive:path $( [ $( $derive_arg:ident ),+ ] )?
$derive:path $( [ $( $derive_arg:tt ),+ ] )?
),+;
)?
$(