@@ -32,7 +32,7 @@ pub enum AddressFamily {
32
32
Unix = consts:: AF_UNIX ,
33
33
Inet = consts:: AF_INET ,
34
34
Inet6 = consts:: AF_INET6 ,
35
- #[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
35
+ #[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
36
36
Netlink = consts:: AF_NETLINK ,
37
37
}
38
38
@@ -464,7 +464,7 @@ impl fmt::Display for UnixAddr {
464
464
pub enum SockAddr {
465
465
Inet ( InetAddr ) ,
466
466
Unix ( UnixAddr ) ,
467
- #[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
467
+ #[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
468
468
Netlink ( NetlinkAddr )
469
469
}
470
470
@@ -477,7 +477,7 @@ impl SockAddr {
477
477
Ok ( SockAddr :: Unix ( try!( UnixAddr :: new ( path) ) ) )
478
478
}
479
479
480
- #[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
480
+ #[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
481
481
pub fn new_netlink ( pid : u32 , groups : u32 ) -> SockAddr {
482
482
SockAddr :: Netlink ( NetlinkAddr :: new ( pid, groups) )
483
483
}
@@ -487,7 +487,7 @@ impl SockAddr {
487
487
SockAddr :: Inet ( InetAddr :: V4 ( ..) ) => AddressFamily :: Inet ,
488
488
SockAddr :: Inet ( InetAddr :: V6 ( ..) ) => AddressFamily :: Inet6 ,
489
489
SockAddr :: Unix ( ..) => AddressFamily :: Unix ,
490
- #[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
490
+ #[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
491
491
SockAddr :: Netlink ( ..) => AddressFamily :: Netlink ,
492
492
}
493
493
}
@@ -501,7 +501,7 @@ impl SockAddr {
501
501
SockAddr :: Inet ( InetAddr :: V4 ( ref addr) ) => ( mem:: transmute ( addr) , mem:: size_of :: < libc:: sockaddr_in > ( ) as libc:: socklen_t ) ,
502
502
SockAddr :: Inet ( InetAddr :: V6 ( ref addr) ) => ( mem:: transmute ( addr) , mem:: size_of :: < libc:: sockaddr_in6 > ( ) as libc:: socklen_t ) ,
503
503
SockAddr :: Unix ( UnixAddr ( ref addr, len) ) => ( mem:: transmute ( addr) , ( len + mem:: size_of :: < libc:: sa_family_t > ( ) ) as libc:: socklen_t ) ,
504
- #[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
504
+ #[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
505
505
SockAddr :: Netlink ( NetlinkAddr ( ref sa) ) => ( mem:: transmute ( sa) , mem:: size_of :: < sockaddr_nl > ( ) as libc:: socklen_t ) ,
506
506
}
507
507
}
@@ -516,7 +516,7 @@ impl PartialEq for SockAddr {
516
516
( SockAddr :: Unix ( ref a) , SockAddr :: Unix ( ref b) ) => {
517
517
a == b
518
518
}
519
- #[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
519
+ #[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
520
520
( SockAddr :: Netlink ( ref a) , SockAddr :: Netlink ( ref b) ) => {
521
521
a == b
522
522
}
@@ -533,7 +533,7 @@ impl hash::Hash for SockAddr {
533
533
match * self {
534
534
SockAddr :: Inet ( ref a) => a. hash ( s) ,
535
535
SockAddr :: Unix ( ref a) => a. hash ( s) ,
536
- #[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
536
+ #[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
537
537
SockAddr :: Netlink ( ref a) => a. hash ( s) ,
538
538
}
539
539
}
@@ -550,7 +550,7 @@ impl fmt::Display for SockAddr {
550
550
match * self {
551
551
SockAddr :: Inet ( ref inet) => inet. fmt ( f) ,
552
552
SockAddr :: Unix ( ref unix) => unix. fmt ( f) ,
553
- #[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
553
+ #[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
554
554
SockAddr :: Netlink ( ref nl) => nl. fmt ( f) ,
555
555
}
556
556
}
0 commit comments