This commit is contained in:
Dario Nieuwenhuis
2022-07-22 15:22:00 +02:00
parent 715fa51468
commit f9f2de3dfb
2 changed files with 18 additions and 65 deletions

View File

@ -82,14 +82,12 @@ macro_rules! unborrow {
#[macro_export]
macro_rules! unsafe_impl_unborrow {
($type:ident) => {
unsafe impl $crate::Unborrow for $type {
impl $crate::Unborrow for $type {
type Target = $type;
#[inline]
fn unborrow<'a>(self) -> $crate::Unborrowed<'a, Self::Target>
where
Self: 'a,
{
$crate::Unborrowed::new(self)
unsafe fn unborrow_unchecked(&mut self) -> Self::Target {
$type { ..*self }
}
}
};