Reuse unsafe_impl_unborrow in other macros.
This commit is contained in:
parent
bff0ad9286
commit
715fa51468
@ -21,16 +21,7 @@ macro_rules! peripherals {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$(#[$cfg])?
|
$(#[$cfg])?
|
||||||
unsafe impl $crate::Unborrow for $name {
|
$crate::unsafe_impl_unborrow!($name);
|
||||||
type Target = $name;
|
|
||||||
#[inline]
|
|
||||||
fn unborrow<'a>(self) -> $crate::Unborrowed<'a, Self::Target>
|
|
||||||
where
|
|
||||||
Self: 'a,
|
|
||||||
{
|
|
||||||
$crate::Unborrowed::new(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)*
|
)*
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,15 +25,7 @@ pub fn run(name: syn::Ident) -> Result<TokenStream, TokenStream> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe impl ::embassy_hal_common::Unborrow for #name_interrupt {
|
::embassy_hal_common::unsafe_impl_unborrow!(#name_interrupt);
|
||||||
type Target = #name_interrupt;
|
|
||||||
fn unborrow<'a>(self) -> ::embassy_hal_common::Unborrowed<'a, #name_interrupt>
|
|
||||||
where
|
|
||||||
Self: 'a
|
|
||||||
{
|
|
||||||
::embassy_hal_common::Unborrowed::new(self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
Ok(result)
|
Ok(result)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user