diff options
| author | Dario Nieuwenhuis <[email protected]> | 2021-05-19 22:31:09 +0200 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2021-05-19 23:20:26 +0200 |
| commit | dc67d2f4a49f4c9166fdefa4319a0e6dfab823e8 (patch) | |
| tree | a762c05590c708335c182d4a4f9d2a23c20c0018 /embassy-macros/src | |
| parent | 22e6a35598ec91b0ef56b2292f842c371ba85b1e (diff) | |
impl Unborrow for &'a mut T
This plays nicer with user code that's generic over peripheral traits like `Instance` or `Pin`.
Diffstat (limited to 'embassy-macros/src')
| -rw-r--r-- | embassy-macros/src/lib.rs | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/embassy-macros/src/lib.rs b/embassy-macros/src/lib.rs index c2f928b93..ac856bef6 100644 --- a/embassy-macros/src/lib.rs +++ b/embassy-macros/src/lib.rs | |||
| @@ -216,13 +216,6 @@ pub fn interrupt_declare(item: TokenStream) -> TokenStream { | |||
| 216 | self | 216 | self |
| 217 | } | 217 | } |
| 218 | } | 218 | } |
| 219 | |||
| 220 | impl ::embassy::util::Unborrow for &mut #name_interrupt { | ||
| 221 | type Target = #name_interrupt; | ||
| 222 | unsafe fn unborrow(self) -> #name_interrupt { | ||
| 223 | ::core::ptr::read(self) | ||
| 224 | } | ||
| 225 | } | ||
| 226 | }; | 219 | }; |
| 227 | result.into() | 220 | result.into() |
| 228 | } | 221 | } |
