make State::new() const, consistent with others

This commit is contained in:
Vincent Stakenburg 2022-09-15 12:34:17 +02:00 committed by Mathias
parent ea5f2c71e0
commit 7bb9620b1a
3 changed files with 3 additions and 3 deletions

View file

@ -29,7 +29,7 @@ use super::*;
pub struct State<'d, T: Instance, const TX: usize, const RX: usize>(StateStorage<Inner<'d, T, TX, RX>>); pub struct State<'d, T: Instance, const TX: usize, const RX: usize>(StateStorage<Inner<'d, T, TX, RX>>);
impl<'d, T: Instance, const TX: usize, const RX: usize> State<'d, T, TX, RX> { impl<'d, T: Instance, const TX: usize, const RX: usize> State<'d, T, TX, RX> {
pub fn new() -> Self { pub const fn new() -> Self {
Self(StateStorage::new()) Self(StateStorage::new())
} }
} }

View file

@ -19,7 +19,7 @@ use super::*;
pub struct State<'d, T: Instance, const TX: usize, const RX: usize>(StateStorage<Inner<'d, T, TX, RX>>); pub struct State<'d, T: Instance, const TX: usize, const RX: usize>(StateStorage<Inner<'d, T, TX, RX>>);
impl<'d, T: Instance, const TX: usize, const RX: usize> State<'d, T, TX, RX> { impl<'d, T: Instance, const TX: usize, const RX: usize> State<'d, T, TX, RX> {
pub fn new() -> Self { pub const fn new() -> Self {
Self(StateStorage::new()) Self(StateStorage::new())
} }
} }

View file

@ -11,7 +11,7 @@ use super::*;
pub struct State<'d, T: BasicInstance>(StateStorage<StateInner<'d, T>>); pub struct State<'d, T: BasicInstance>(StateStorage<StateInner<'d, T>>);
impl<'d, T: BasicInstance> State<'d, T> { impl<'d, T: BasicInstance> State<'d, T> {
pub fn new() -> Self { pub const fn new() -> Self {
Self(StateStorage::new()) Self(StateStorage::new())
} }
} }