From 6af8dccab49acb6d977aa29ee987f6ca15d98520 Mon Sep 17 00:00:00 2001 From: Albin Hedman Date: Sun, 17 Nov 2024 00:06:05 +0100 Subject: [PATCH] HRTIM - Use non_exhaustive on EevInput to make its constructor private Co-authored-by: Zgarbul Andrey --- src/hrtim/external_event.rs | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/hrtim/external_event.rs b/src/hrtim/external_event.rs index ee88262e..3a7b9e1b 100644 --- a/src/hrtim/external_event.rs +++ b/src/hrtim/external_event.rs @@ -30,23 +30,22 @@ pub struct EevInputs { impl EevInputs { pub(crate) unsafe fn new() -> Self { EevInputs { - eev_input1: EevInput { _x: PhantomData }, - eev_input2: EevInput { _x: PhantomData }, - eev_input3: EevInput { _x: PhantomData }, - eev_input4: EevInput { _x: PhantomData }, - eev_input5: EevInput { _x: PhantomData }, - eev_input6: EevInput { _x: PhantomData }, - eev_input7: EevInput { _x: PhantomData }, - eev_input8: EevInput { _x: PhantomData }, - eev_input9: EevInput { _x: PhantomData }, - eev_input10: EevInput { _x: PhantomData }, + eev_input1: EevInput, + eev_input2: EevInput, + eev_input3: EevInput, + eev_input4: EevInput, + eev_input5: EevInput, + eev_input6: EevInput, + eev_input7: EevInput, + eev_input8: EevInput, + eev_input9: EevInput, + eev_input10: EevInput, } } } -pub struct EevInput { - _x: PhantomData<()>, -} +#[non_exhaustive] +pub struct EevInput; /// This is implemented for types that can be used as inputs to the eev /// # Safety