Skip to content

Commit

Permalink
Make Address:v6() constructor const
Browse files Browse the repository at this point in the history
  • Loading branch information
sciguy16 committed Aug 16, 2024
1 parent dc08e0b commit 485f29c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/wire/ip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,16 @@ impl Address {
/// Create an address wrapping an IPv6 address with the given octets.
#[cfg(feature = "proto-ipv6")]
#[allow(clippy::too_many_arguments)]
pub fn v6(a0: u16, a1: u16, a2: u16, a3: u16, a4: u16, a5: u16, a6: u16, a7: u16) -> Address {
pub const fn v6(
a0: u16,
a1: u16,
a2: u16,
a3: u16,
a4: u16,
a5: u16,
a6: u16,
a7: u16,
) -> Address {
Address::Ipv6(Ipv6Address::new(a0, a1, a2, a3, a4, a5, a6, a7))
}

Expand Down

0 comments on commit 485f29c

Please sign in to comment.