summaryrefslogtreecommitdiff
path: root/embassy-stm32
diff options
context:
space:
mode:
authorVincent Stakenburg <v.stakenburg@sinewave.nl>2022-09-15 12:34:17 +0200
committerVincent Stakenburg <v.stakenburg@sinewave.nl>2022-09-15 12:34:17 +0200
commitc4d5c047d7311e506ee1c0c9322cbf4e72dd6bcc (patch)
tree759eb77a06387845654633d617aef77376668af7 /embassy-stm32
parent809a4a127ba03ab14e8fdd8e8d2dc1e1e51f3522 (diff)
downloadembassy-c4d5c047d7311e506ee1c0c9322cbf4e72dd6bcc.zip
make `State::new()` const, consistent with others
Diffstat (limited to 'embassy-stm32')
-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 1ab0438a..38629a93 100644
--- a/embassy-stm32/src/eth/v1/mod.rs
+++ b/embassy-stm32/src/eth/v1/mod.rs
@@ -29,7 +29,7 @@ use super::*;
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> {
- pub fn new() -> Self {
+ pub const fn new() -> Self {
Self(StateStorage::new())
}
}
diff --git a/embassy-stm32/src/eth/v2/mod.rs b/embassy-stm32/src/eth/v2/mod.rs
index d67c3c5e..a81ee118 100644
--- a/embassy-stm32/src/eth/v2/mod.rs
+++ b/embassy-stm32/src/eth/v2/mod.rs
@@ -19,7 +19,7 @@ use super::*;
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> {
- pub fn new() -> Self {
+ pub const fn new() -> Self {
Self(StateStorage::new())
}
}
diff --git a/embassy-stm32/src/usart/buffered.rs b/embassy-stm32/src/usart/buffered.rs
index a7fa4389..5f6dabb3 100644
--- a/embassy-stm32/src/usart/buffered.rs
+++ b/embassy-stm32/src/usart/buffered.rs
@@ -11,7 +11,7 @@ use super::*;
pub struct State<'d, T: BasicInstance>(StateStorage<StateInner<'d, T>>);
impl<'d, T: BasicInstance> State<'d, T> {
- pub fn new() -> Self {
+ pub const fn new() -> Self {
Self(StateStorage::new())
}
}