@@ -961,11 +961,6 @@ impl AsInner<c::in_addr> for Ipv4Addr {
961
961
& self . inner
962
962
}
963
963
}
964
- impl FromInner < c:: in_addr > for Ipv4Addr {
965
- fn from_inner ( addr : c:: in_addr ) -> Ipv4Addr {
966
- Ipv4Addr { inner : addr }
967
- }
968
- }
969
964
970
965
#[ stable( feature = "ip_u32" , since = "1.1.0" ) ]
971
966
impl From < Ipv4Addr > for u32 {
@@ -976,8 +971,8 @@ impl From<Ipv4Addr> for u32 {
976
971
/// ```
977
972
/// use std::net::Ipv4Addr;
978
973
///
979
- /// let addr = Ipv4Addr::new(13, 12, 11, 10 );
980
- /// assert_eq!(0x0d0c0b0au32 , u32::from(addr));
974
+ /// let addr = Ipv4Addr::new(0xca, 0xfe, 0xba, 0xbe );
975
+ /// assert_eq!(0xcafebabe , u32::from(addr));
981
976
/// ```
982
977
fn from ( ip : Ipv4Addr ) -> u32 {
983
978
let ip = ip. octets ( ) ;
@@ -994,8 +989,8 @@ impl From<u32> for Ipv4Addr {
994
989
/// ```
995
990
/// use std::net::Ipv4Addr;
996
991
///
997
- /// let addr = Ipv4Addr::from(0x0d0c0b0au32 );
998
- /// assert_eq!(Ipv4Addr::new(13, 12, 11, 10 ), addr);
992
+ /// let addr = Ipv4Addr::from(0xcafebabe );
993
+ /// assert_eq!(Ipv4Addr::new(0xca, 0xfe, 0xba, 0xbe ), addr);
999
994
/// ```
1000
995
fn from ( ip : u32 ) -> Ipv4Addr {
1001
996
Ipv4Addr :: from ( ip. to_be_bytes ( ) )
0 commit comments