aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Stakenburg <[email protected]>2022-09-15 12:34:17 +0200
committerVincent Stakenburg <[email protected]>2022-09-15 12:34:17 +0200
commitc4d5c047d7311e506ee1c0c9322cbf4e72dd6bcc (patch)
tree759eb77a06387845654633d617aef77376668af7
parent809a4a127ba03ab14e8fdd8e8d2dc1e1e51f3522 (diff)
make `State::new()` const, consistent with others
-rw-r--r--embassy-stm32/src/eth/v1/mod.rs2
-rw-r--r--embassy-stm32/src/eth/v2/mod.rs2
-rw-r--r--embassy-stm32/src/usart/buffered.rs2
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
30pub struct State<'d, T: Instance, const TX: usize, const RX: usize>(StateStorage<Inner<'d, T, TX, RX>>); 30pub struct State<'d, T: Instance, const TX: usize, const RX: usize>(StateStorage<Inner<'d, T, TX, RX>>);
31impl<'d, T: Instance, const TX: usize, const RX: usize> State<'d, T, TX, RX> { 31impl<'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
20pub struct State<'d, T: Instance, const TX: usize, const RX: usize>(StateStorage<Inner<'d, T, TX, RX>>); 20pub struct State<'d, T: Instance, const TX: usize, const RX: usize>(StateStorage<Inner<'d, T, TX, RX>>);
21impl<'d, T: Instance, const TX: usize, const RX: usize> State<'d, T, TX, RX> { 21impl<'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
12pub struct State<'d, T: BasicInstance>(StateStorage<StateInner<'d, T>>); 12pub struct State<'d, T: BasicInstance>(StateStorage<StateInner<'d, T>>);
13impl<'d, T: BasicInstance> State<'d, T> { 13impl<'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}