From 43cb8de4344cb8400632b125c2391d128090c86e Mon Sep 17 00:00:00 2001 From: Bob McWhirter Date: Wed, 14 Jul 2021 14:37:42 -0400 Subject: [PATCH] Remove gratuitous NoDmaMarker. --- embassy-stm32/src/dma_traits.rs | 4 ---- embassy-stm32/src/usart/v3.rs | 7 ++----- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/embassy-stm32/src/dma_traits.rs b/embassy-stm32/src/dma_traits.rs index 518e10dcb..6733d911a 100644 --- a/embassy-stm32/src/dma_traits.rs +++ b/embassy-stm32/src/dma_traits.rs @@ -21,12 +21,8 @@ pub trait ReadDma { T: 'a; } -pub trait NoDmaMarker {} - pub struct NoDma; -impl NoDmaMarker for NoDma {} - unsafe impl Unborrow for NoDma { type Target = NoDma; diff --git a/embassy-stm32/src/usart/v3.rs b/embassy-stm32/src/usart/v3.rs index 3029bf6e4..4d78abb24 100644 --- a/embassy-stm32/src/usart/v3.rs +++ b/embassy-stm32/src/usart/v3.rs @@ -10,7 +10,6 @@ use core::future::Future; use futures::TryFutureExt; use crate::dma_traits::NoDma; -use crate::dma_traits::NoDmaMarker; #[allow(dead_code)] pub struct Uart<'d, T: Instance, TxDma = NoDma, RxDma = NoDma> { @@ -114,10 +113,8 @@ impl<'d, T: Instance, TxDma, RxDma> Uart<'d, T, TxDma, RxDma> { } } -impl<'d, T: Instance, TxDma, RxDma> embedded_hal::blocking::serial::Write - for Uart<'d, T, TxDma, RxDma> -where - TxDma: NoDmaMarker, +impl<'d, T: Instance, RxDma> embedded_hal::blocking::serial::Write + for Uart<'d, T, NoDma, RxDma> { type Error = Error; fn bwrite_all(&mut self, buffer: &[u8]) -> Result<(), Self::Error> {