diff --git a/embassy-hal-common/src/peripheral.rs b/embassy-hal-common/src/peripheral.rs index d3df06e86..46c6ebeee 100644 --- a/embassy-hal-common/src/peripheral.rs +++ b/embassy-hal-common/src/peripheral.rs @@ -17,7 +17,7 @@ pub trait PeripheralState: Send { pub struct StateStorage(MaybeUninit); impl StateStorage { - pub fn new() -> Self { + pub const fn new() -> Self { Self(MaybeUninit::uninit()) } } diff --git a/embassy-stm32/src/eth/v2/mod.rs b/embassy-stm32/src/eth/v2/mod.rs index 37bc9715a..cfb461ab3 100644 --- a/embassy-stm32/src/eth/v2/mod.rs +++ b/embassy-stm32/src/eth/v2/mod.rs @@ -20,7 +20,7 @@ use descriptors::DescriptorRing; pub struct State<'d, const TX: usize, const RX: usize>(StateStorage>); impl<'d, const TX: usize, const RX: usize> State<'d, TX, RX> { - pub fn new() -> Self { + pub const fn new() -> Self { Self(StateStorage::new()) } }