From 248f71dbfa5c534215d89889c02b755b38457298 Mon Sep 17 00:00:00 2001 From: Gwilym Inzani Date: Mon, 27 May 2024 13:20:13 +0100 Subject: [PATCH] Remove lifetime from DMA transfer handle --- agb/src/dma.rs | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/agb/src/dma.rs b/agb/src/dma.rs index a16fc021..b1a3aac9 100644 --- a/agb/src/dma.rs +++ b/agb/src/dma.rs @@ -77,11 +77,11 @@ impl Dma { /// # Examples /// /// See the `dma_effect_*` examples in the repository to see some ways to use this. - pub unsafe fn hblank_transfer<'a, T>( - &'a self, + pub unsafe fn hblank_transfer( + &self, location: &DmaControllable, - values: &'a [T], - ) -> DmaTransferHandle<'a, T> + values: &[T], + ) -> DmaTransferHandle where T: Copy, { @@ -127,17 +127,15 @@ impl DmaControllable { } } -pub struct DmaTransferHandle<'a, T> +pub struct DmaTransferHandle where T: Copy, { number: usize, data: Pin>, - - phantom: PhantomData<&'a ()>, } -impl<'a, T> DmaTransferHandle<'a, T> +impl DmaTransferHandle where T: Copy, { @@ -145,12 +143,11 @@ where Self { number, data: Box::into_pin(data.into()), - phantom: PhantomData, } } } -impl<'a, T> Drop for DmaTransferHandle<'a, T> +impl Drop for DmaTransferHandle where T: Copy, {