File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -144,7 +144,7 @@ impl Ipv4Network {
144144 self . addr
145145 }
146146
147- pub fn prefix ( self ) -> u8 {
147+ pub const fn prefix ( self ) -> u8 {
148148 self . prefix
149149 }
150150
Original file line number Diff line number Diff line change @@ -164,7 +164,7 @@ impl Ipv6Network {
164164 self . addr
165165 }
166166
167- pub fn prefix ( & self ) -> u8 {
167+ pub const fn prefix ( & self ) -> u8 {
168168 self . prefix
169169 }
170170
Original file line number Diff line number Diff line change @@ -160,7 +160,7 @@ impl IpNetwork {
160160 /// assert_eq!(IpNetwork::V6("ff01::0".parse().unwrap()).prefix(), 128u8);
161161 /// assert_eq!(IpNetwork::V6("ff01::0/32".parse().unwrap()).prefix(), 32u8);
162162 /// ```
163- pub fn prefix ( & self ) -> u8 {
163+ pub const fn prefix ( & self ) -> u8 {
164164 match * self {
165165 IpNetwork :: V4 ( ref a) => a. prefix ( ) ,
166166 IpNetwork :: V6 ( ref a) => a. prefix ( ) ,
You can’t perform that action at this time.
0 commit comments