File tree Expand file tree Collapse file tree 1 file changed +2
-0
lines changed Expand file tree Collapse file tree 1 file changed +2
-0
lines changed Original file line number Diff line number Diff line change @@ -636,6 +636,7 @@ impl FromInner<c::in_addr> for Ipv4Addr {
636
636
637
637
#[ stable( feature = "ip_u32" , since = "1.1.0" ) ]
638
638
impl From < Ipv4Addr > for u32 {
639
+ /// It performs the conversion in network order (big-endian).
639
640
fn from ( ip : Ipv4Addr ) -> u32 {
640
641
let ip = ip. octets ( ) ;
641
642
( ( ip[ 0 ] as u32 ) << 24 ) + ( ( ip[ 1 ] as u32 ) << 16 ) + ( ( ip[ 2 ] as u32 ) << 8 ) + ( ip[ 3 ] as u32 )
@@ -644,6 +645,7 @@ impl From<Ipv4Addr> for u32 {
644
645
645
646
#[ stable( feature = "ip_u32" , since = "1.1.0" ) ]
646
647
impl From < u32 > for Ipv4Addr {
648
+ /// It performs the conversion in network order (big-endian).
647
649
fn from ( ip : u32 ) -> Ipv4Addr {
648
650
Ipv4Addr :: new ( ( ip >> 24 ) as u8 , ( ip >> 16 ) as u8 , ( ip >> 8 ) as u8 , ip as u8 )
649
651
}
You can’t perform that action at this time.
0 commit comments