diff options
| author | Vincent Stakenburg <[email protected]> | 2022-09-15 12:34:17 +0200 |
|---|---|---|
| committer | Vincent Stakenburg <[email protected]> | 2022-09-15 12:34:17 +0200 |
| commit | c4d5c047d7311e506ee1c0c9322cbf4e72dd6bcc (patch) | |
| tree | 759eb77a06387845654633d617aef77376668af7 /embassy-stm32/src | |
| parent | 809a4a127ba03ab14e8fdd8e8d2dc1e1e51f3522 (diff) | |
make `State::new()` const, consistent with others
Diffstat (limited to 'embassy-stm32/src')
| -rw-r--r-- | embassy-stm32/src/eth/v1/mod.rs | 2 | ||||
| -rw-r--r-- | embassy-stm32/src/eth/v2/mod.rs | 2 | ||||
| -rw-r--r-- | embassy-stm32/src/usart/buffered.rs | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/embassy-stm32/src/eth/v1/mod.rs b/embassy-stm32/src/eth/v1/mod.rs index 1ab0438ad..38629a932 100644 --- a/embassy-stm32/src/eth/v1/mod.rs +++ b/embassy-stm32/src/eth/v1/mod.rs | |||
| @@ -29,7 +29,7 @@ use super::*; | |||
| 29 | 29 | ||
| 30 | pub struct State<'d, T: Instance, const TX: usize, const RX: usize>(StateStorage<Inner<'d, T, TX, RX>>); | 30 | pub struct State<'d, T: Instance, const TX: usize, const RX: usize>(StateStorage<Inner<'d, T, TX, RX>>); |
| 31 | impl<'d, T: Instance, const TX: usize, const RX: usize> State<'d, T, TX, RX> { | 31 | impl<'d, T: Instance, const TX: usize, const RX: usize> State<'d, T, TX, RX> { |
| 32 | pub fn new() -> Self { | 32 | pub const fn new() -> Self { |
| 33 | Self(StateStorage::new()) | 33 | Self(StateStorage::new()) |
| 34 | } | 34 | } |
| 35 | } | 35 | } |
diff --git a/embassy-stm32/src/eth/v2/mod.rs b/embassy-stm32/src/eth/v2/mod.rs index d67c3c5e4..a81ee1183 100644 --- a/embassy-stm32/src/eth/v2/mod.rs +++ b/embassy-stm32/src/eth/v2/mod.rs | |||
| @@ -19,7 +19,7 @@ use super::*; | |||
| 19 | 19 | ||
| 20 | pub struct State<'d, T: Instance, const TX: usize, const RX: usize>(StateStorage<Inner<'d, T, TX, RX>>); | 20 | pub struct State<'d, T: Instance, const TX: usize, const RX: usize>(StateStorage<Inner<'d, T, TX, RX>>); |
| 21 | impl<'d, T: Instance, const TX: usize, const RX: usize> State<'d, T, TX, RX> { | 21 | impl<'d, T: Instance, const TX: usize, const RX: usize> State<'d, T, TX, RX> { |
| 22 | pub fn new() -> Self { | 22 | pub const fn new() -> Self { |
| 23 | Self(StateStorage::new()) | 23 | Self(StateStorage::new()) |
| 24 | } | 24 | } |
| 25 | } | 25 | } |
diff --git a/embassy-stm32/src/usart/buffered.rs b/embassy-stm32/src/usart/buffered.rs index a7fa43894..5f6dabb3b 100644 --- a/embassy-stm32/src/usart/buffered.rs +++ b/embassy-stm32/src/usart/buffered.rs | |||
| @@ -11,7 +11,7 @@ use super::*; | |||
| 11 | 11 | ||
| 12 | pub struct State<'d, T: BasicInstance>(StateStorage<StateInner<'d, T>>); | 12 | pub struct State<'d, T: BasicInstance>(StateStorage<StateInner<'d, T>>); |
| 13 | impl<'d, T: BasicInstance> State<'d, T> { | 13 | impl<'d, T: BasicInstance> State<'d, T> { |
| 14 | pub fn new() -> Self { | 14 | pub const fn new() -> Self { |
| 15 | Self(StateStorage::new()) | 15 | Self(StateStorage::new()) |
| 16 | } | 16 | } |
| 17 | } | 17 | } |
