impl Unborrow for &'a mut T

This plays nicer with user code that's generic over peripheral traits like `Instance` or `Pin`.
This commit is contained in:
Dario Nieuwenhuis
2021-05-19 22:31:09 +02:00
parent 22e6a35598
commit dc67d2f4a4
3 changed files with 7 additions and 34 deletions

View File

@ -216,13 +216,6 @@ pub fn interrupt_declare(item: TokenStream) -> TokenStream {
self
}
}
impl ::embassy::util::Unborrow for &mut #name_interrupt {
type Target = #name_interrupt;
unsafe fn unborrow(self) -> #name_interrupt {
::core::ptr::read(self)
}
}
};
result.into()
}