diff options
| author | Ulf Lilleengen <[email protected]> | 2024-12-10 13:40:26 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-12-10 13:40:26 +0000 |
| commit | 406d377b7564d16e12b7fae4f42c0c709bf4f243 (patch) | |
| tree | 72c624c5d05f32136e20869a12ba0c46e258cf84 | |
| parent | 080900c8d11b25aaa9fdece4d03a73386ad622fd (diff) | |
| parent | 1e2cbeae68d12a37ff73292294bb96c9282476bd (diff) | |
Merge pull request #3632 from ROMemories/fix/make-net-config-constructors-const
fix(embassy-net): make the `Config` constructors `const`
| -rw-r--r-- | embassy-net/src/lib.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/embassy-net/src/lib.rs b/embassy-net/src/lib.rs index ec7f10fdd..831e01d44 100644 --- a/embassy-net/src/lib.rs +++ b/embassy-net/src/lib.rs | |||
| @@ -180,7 +180,7 @@ pub struct Config { | |||
| 180 | impl Config { | 180 | impl Config { |
| 181 | /// IPv4 configuration with static addressing. | 181 | /// IPv4 configuration with static addressing. |
| 182 | #[cfg(feature = "proto-ipv4")] | 182 | #[cfg(feature = "proto-ipv4")] |
| 183 | pub fn ipv4_static(config: StaticConfigV4) -> Self { | 183 | pub const fn ipv4_static(config: StaticConfigV4) -> Self { |
| 184 | Self { | 184 | Self { |
| 185 | ipv4: ConfigV4::Static(config), | 185 | ipv4: ConfigV4::Static(config), |
| 186 | #[cfg(feature = "proto-ipv6")] | 186 | #[cfg(feature = "proto-ipv6")] |
| @@ -190,7 +190,7 @@ impl Config { | |||
| 190 | 190 | ||
| 191 | /// IPv6 configuration with static addressing. | 191 | /// IPv6 configuration with static addressing. |
| 192 | #[cfg(feature = "proto-ipv6")] | 192 | #[cfg(feature = "proto-ipv6")] |
| 193 | pub fn ipv6_static(config: StaticConfigV6) -> Self { | 193 | pub const fn ipv6_static(config: StaticConfigV6) -> Self { |
| 194 | Self { | 194 | Self { |
| 195 | #[cfg(feature = "proto-ipv4")] | 195 | #[cfg(feature = "proto-ipv4")] |
| 196 | ipv4: ConfigV4::None, | 196 | ipv4: ConfigV4::None, |
| @@ -206,7 +206,7 @@ impl Config { | |||
| 206 | /// let _cfg = Config::dhcpv4(Default::default()); | 206 | /// let _cfg = Config::dhcpv4(Default::default()); |
| 207 | /// ``` | 207 | /// ``` |
| 208 | #[cfg(feature = "dhcpv4")] | 208 | #[cfg(feature = "dhcpv4")] |
| 209 | pub fn dhcpv4(config: DhcpConfig) -> Self { | 209 | pub const fn dhcpv4(config: DhcpConfig) -> Self { |
| 210 | Self { | 210 | Self { |
| 211 | ipv4: ConfigV4::Dhcp(config), | 211 | ipv4: ConfigV4::Dhcp(config), |
| 212 | #[cfg(feature = "proto-ipv6")] | 212 | #[cfg(feature = "proto-ipv6")] |
