@@ -28,17 +28,10 @@ pub struct UCred {
2828#[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
2929pub use self :: impl_linux:: peer_cred;
3030
31- #[ cfg( any(
32- target_os = "dragonfly" ,
33- target_os = "freebsd" ,
34- target_os = "openbsd"
35- ) ) ]
31+ #[ cfg( any( target_os = "dragonfly" , target_os = "freebsd" , target_os = "openbsd" ) ) ]
3632pub use self :: impl_bsd:: peer_cred;
3733
38- #[ cfg( any(
39- target_os = "macos" ,
40- target_os = "ios" ,
41- ) ) ]
34+ #[ cfg( any( target_os = "macos" , target_os = "ios" , ) ) ]
4235pub use self :: impl_mac:: peer_cred;
4336
4437#[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
@@ -77,11 +70,7 @@ pub mod impl_linux {
7770 }
7871}
7972
80- #[ cfg( any(
81- target_os = "dragonfly" ,
82- target_os = "freebsd" ,
83- target_os = "openbsd"
84- ) ) ]
73+ #[ cfg( any( target_os = "dragonfly" , target_os = "freebsd" , target_os = "openbsd" ) ) ]
8574pub mod impl_bsd {
8675 use super :: UCred ;
8776 use crate :: io;
@@ -98,16 +87,13 @@ pub mod impl_bsd {
9887 }
9988}
10089
101- #[ cfg( any(
102- target_os = "macos" ,
103- target_os = "ios" ,
104- ) ) ]
90+ #[ cfg( any( target_os = "macos" , target_os = "ios" , ) ) ]
10591pub mod impl_mac {
10692 use super :: UCred ;
107- use crate :: { io, mem} ;
10893 use crate :: os:: unix:: io:: AsRawFd ;
10994 use crate :: os:: unix:: net:: UnixStream ;
110- use libc:: { c_void, getpeereid, getsockopt, pid_t, socklen_t, SOL_LOCAL , LOCAL_PEERPID } ;
95+ use crate :: { io, mem} ;
96+ use libc:: { c_void, getpeereid, getsockopt, pid_t, socklen_t, LOCAL_PEERPID , SOL_LOCAL } ;
11197
11298 pub fn peer_cred ( socket : & UnixStream ) -> io:: Result < UCred > {
11399 let mut cred = UCred { uid : 1 , gid : 1 , pid : None } ;
@@ -126,7 +112,7 @@ pub mod impl_mac {
126112 SOL_LOCAL ,
127113 LOCAL_PEERPID ,
128114 & mut pid as * mut pid_t as * mut c_void ,
129- & mut pid_size
115+ & mut pid_size,
130116 ) ;
131117
132118 if ret == 0 && pid_size as usize == mem:: size_of :: < pid_t > ( ) {
0 commit comments