From 91851964ff5da36d94f5e6d942c7fc7f3cf89602 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Wed, 7 Jul 2021 14:36:46 +0200 Subject: [PATCH] Address review comments --- nrf-hal-common/src/usbd.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/nrf-hal-common/src/usbd.rs b/nrf-hal-common/src/usbd.rs index 9557d045..42b666cf 100644 --- a/nrf-hal-common/src/usbd.rs +++ b/nrf-hal-common/src/usbd.rs @@ -1,18 +1,22 @@ +use core::marker::PhantomData; + use crate::clocks::ExternalOscillator; use crate::pac::USBD; use crate::Clocks; pub use nrf_usbd::Usbd; -#[allow(dead_code)] // fields are unused and only hold ownership pub struct UsbPeripheral<'a> { - usbd: USBD, - clocks: &'a (), + _usbd: USBD, + _clocks: PhantomData<&'a ()>, } impl<'a> UsbPeripheral<'a> { pub fn new(usbd: USBD, _clocks: &'a Clocks) -> Self { - Self { usbd, clocks: &() } + Self { + _usbd: usbd, + _clocks: PhantomData, + } } }