Compare commits
1 commit
91e8771e81
...
363609c663
Author | SHA1 | Date | |
---|---|---|---|
![]() |
363609c663 |
|
@ -1,27 +1,23 @@
|
||||||
macro_rules! derive_free {
|
macro_rules! derive_free {
|
||||||
($typ:ident) => {
|
($object_type:ident) => {
|
||||||
::paste::paste! {
|
$crate::macros::wrap_method!($object_type;
|
||||||
$crate::macros::wrap_method!($typ;
|
#[doc = concat!("Deallocates a [`", stringify!($object_type), "`] instance.")]
|
||||||
#[doc = "Deallocates a [`" $typ "`] instance."]
|
#[allow(dropping_copy_types)]
|
||||||
#[allow(dropping_copy_types)]
|
fn free(move instance) {
|
||||||
fn free(move instance) {
|
::std::mem::drop(instance)
|
||||||
::std::mem::drop(instance)
|
};
|
||||||
};
|
);
|
||||||
);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
macro_rules! derive_clone {
|
macro_rules! derive_clone {
|
||||||
($object_type:ident) => {
|
($object_type:ident) => {
|
||||||
::paste::paste! {
|
$crate::macros::wrap_method!($object_type;
|
||||||
$crate::macros::wrap_method!($object_type;
|
#[doc = concat!("Clones a [`", stringify!($object_type), "`] instance.")]
|
||||||
#[doc = "Clones a [`" $object_type "`] instance."]
|
fn clone(ref instance) -> move ::core::ptr::NonNull<$object_type> {
|
||||||
fn clone(ref instance) -> move ::core::ptr::NonNull<$object_type> {
|
instance.clone()
|
||||||
instance.clone()
|
};
|
||||||
};
|
);
|
||||||
);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -269,7 +265,7 @@ macro_rules! wrap {
|
||||||
$(
|
$(
|
||||||
derives:
|
derives:
|
||||||
$(
|
$(
|
||||||
$derive:path $( [ $( $derive_arg:ident ),+ ] )?
|
$derive:path $( [ $( $derive_arg:tt ),+ ] )?
|
||||||
),+;
|
),+;
|
||||||
)?
|
)?
|
||||||
$(
|
$(
|
||||||
|
|
Loading…
Reference in a new issue