Make const the states when able.
This commit is contained in:
parent
63ac7ac799
commit
e238079d7d
@ -17,7 +17,7 @@ pub trait PeripheralState: Send {
|
||||
pub struct StateStorage<S>(MaybeUninit<S>);
|
||||
|
||||
impl<S> StateStorage<S> {
|
||||
pub fn new() -> Self {
|
||||
pub const fn new() -> Self {
|
||||
Self(MaybeUninit::uninit())
|
||||
}
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ use descriptors::DescriptorRing;
|
||||
|
||||
pub struct State<'d, const TX: usize, const RX: usize>(StateStorage<Inner<'d, TX, RX>>);
|
||||
impl<'d, const TX: usize, const RX: usize> State<'d, TX, RX> {
|
||||
pub fn new() -> Self {
|
||||
pub const fn new() -> Self {
|
||||
Self(StateStorage::new())
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user