Skip to content

Commit

Permalink
ip: Make Cidr initialization const.
Browse files Browse the repository at this point in the history
  • Loading branch information
matoushybl committed Jan 25, 2025
1 parent 74bd1e5 commit 888f427
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/wire/ip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ impl Cidr {
///
/// # Panics
/// This function panics if the given prefix length is invalid for the given address.
pub fn new(addr: Address, prefix_len: u8) -> Cidr {
pub const fn new(addr: Address, prefix_len: u8) -> Cidr {
match addr {
#[cfg(feature = "proto-ipv4")]
Address::Ipv4(addr) => Cidr::Ipv4(Ipv4Cidr::new(addr, prefix_len)),
Expand Down

0 comments on commit 888f427

Please sign in to comment.