Skip to content

Commit

Permalink
Merge pull request #3632 from ROMemories/fix/make-net-config-construc…
Browse files Browse the repository at this point in the history
…tors-const

fix(embassy-net): make the `Config` constructors `const`
  • Loading branch information
lulf authored Dec 10, 2024
2 parents 080900c + 1e2cbea commit 406d377
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions embassy-net/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ pub struct Config {
impl Config {
/// IPv4 configuration with static addressing.
#[cfg(feature = "proto-ipv4")]
pub fn ipv4_static(config: StaticConfigV4) -> Self {
pub const fn ipv4_static(config: StaticConfigV4) -> Self {
Self {
ipv4: ConfigV4::Static(config),
#[cfg(feature = "proto-ipv6")]
Expand All @@ -190,7 +190,7 @@ impl Config {

/// IPv6 configuration with static addressing.
#[cfg(feature = "proto-ipv6")]
pub fn ipv6_static(config: StaticConfigV6) -> Self {
pub const fn ipv6_static(config: StaticConfigV6) -> Self {
Self {
#[cfg(feature = "proto-ipv4")]
ipv4: ConfigV4::None,
Expand All @@ -206,7 +206,7 @@ impl Config {
/// let _cfg = Config::dhcpv4(Default::default());
/// ```
#[cfg(feature = "dhcpv4")]
pub fn dhcpv4(config: DhcpConfig) -> Self {
pub const fn dhcpv4(config: DhcpConfig) -> Self {
Self {
ipv4: ConfigV4::Dhcp(config),
#[cfg(feature = "proto-ipv6")]
Expand Down

0 comments on commit 406d377

Please sign in to comment.