@@ -6,9 +6,9 @@ use std::fmt;
66use std:: net:: TcpStream ;
77use std:: time:: Duration ;
88use bufstream:: BufStream ;
9- #[ cfg( feature = "unix_socket" ) ]
9+ #[ cfg( feature = "with- unix_socket" ) ]
1010use unix_socket:: UnixStream ;
11- #[ cfg( all( not( feature = "unix_socket" ) , all( unix, feature = "nightly" ) ) ) ]
11+ #[ cfg( all( not( feature = "with- unix_socket" ) , all( unix, feature = "nightly" ) ) ) ]
1212use std:: os:: unix:: net:: UnixStream ;
1313#[ cfg( unix) ]
1414use std:: os:: unix:: io:: { AsRawFd , RawFd } ;
@@ -33,15 +33,15 @@ impl StreamOptions for BufStream<Box<TlsStream>> {
3333 fn set_read_timeout ( & self , timeout : Option < Duration > ) -> io:: Result < ( ) > {
3434 match self . get_ref ( ) . get_ref ( ) . 0 {
3535 InternalStream :: Tcp ( ref s) => s. set_read_timeout ( timeout) ,
36- #[ cfg( any( feature = "unix_socket" , all( unix, feature = "nightly" ) ) ) ]
36+ #[ cfg( any( feature = "with- unix_socket" , all( unix, feature = "nightly" ) ) ) ]
3737 InternalStream :: Unix ( ref s) => s. set_read_timeout ( timeout) ,
3838 }
3939 }
4040
4141 fn set_nonblocking ( & self , nonblock : bool ) -> io:: Result < ( ) > {
4242 match self . get_ref ( ) . get_ref ( ) . 0 {
4343 InternalStream :: Tcp ( ref s) => s. set_nonblocking ( nonblock) ,
44- #[ cfg( any( feature = "unix_socket" , all( unix, feature = "nightly" ) ) ) ]
44+ #[ cfg( any( feature = "with- unix_socket" , all( unix, feature = "nightly" ) ) ) ]
4545 InternalStream :: Unix ( ref s) => s. set_nonblocking ( nonblock) ,
4646 }
4747 }
@@ -57,7 +57,7 @@ impl fmt::Debug for Stream {
5757 fn fmt ( & self , fmt : & mut fmt:: Formatter ) -> fmt:: Result {
5858 match self . 0 {
5959 InternalStream :: Tcp ( ref s) => fmt:: Debug :: fmt ( s, fmt) ,
60- #[ cfg( any( feature = "unix_socket" , all( unix, feature = "nightly" ) ) ) ]
60+ #[ cfg( any( feature = "with- unix_socket" , all( unix, feature = "nightly" ) ) ) ]
6161 InternalStream :: Unix ( ref s) => fmt:: Debug :: fmt ( s, fmt) ,
6262 }
6363 }
@@ -94,7 +94,7 @@ impl AsRawFd for Stream {
9494 fn as_raw_fd ( & self ) -> RawFd {
9595 match self . 0 {
9696 InternalStream :: Tcp ( ref s) => s. as_raw_fd ( ) ,
97- #[ cfg( any( feature = "unix_socket" , all( unix, feature = "nightly" ) ) ) ]
97+ #[ cfg( any( feature = "with- unix_socket" , all( unix, feature = "nightly" ) ) ) ]
9898 InternalStream :: Unix ( ref s) => s. as_raw_fd ( ) ,
9999 }
100100 }
@@ -112,15 +112,15 @@ impl AsRawSocket for Stream {
112112
113113enum InternalStream {
114114 Tcp ( TcpStream ) ,
115- #[ cfg( any( feature = "unix_socket" , all( unix, feature = "nightly" ) ) ) ]
115+ #[ cfg( any( feature = "with- unix_socket" , all( unix, feature = "nightly" ) ) ) ]
116116 Unix ( UnixStream ) ,
117117}
118118
119119impl Read for InternalStream {
120120 fn read ( & mut self , buf : & mut [ u8 ] ) -> io:: Result < usize > {
121121 match * self {
122122 InternalStream :: Tcp ( ref mut s) => s. read ( buf) ,
123- #[ cfg( any( feature = "unix_socket" , all( unix, feature = "nightly" ) ) ) ]
123+ #[ cfg( any( feature = "with- unix_socket" , all( unix, feature = "nightly" ) ) ) ]
124124 InternalStream :: Unix ( ref mut s) => s. read ( buf) ,
125125 }
126126 }
@@ -130,15 +130,15 @@ impl Write for InternalStream {
130130 fn write ( & mut self , buf : & [ u8 ] ) -> io:: Result < usize > {
131131 match * self {
132132 InternalStream :: Tcp ( ref mut s) => s. write ( buf) ,
133- #[ cfg( any( feature = "unix_socket" , all( unix, feature = "nightly" ) ) ) ]
133+ #[ cfg( any( feature = "with- unix_socket" , all( unix, feature = "nightly" ) ) ) ]
134134 InternalStream :: Unix ( ref mut s) => s. write ( buf) ,
135135 }
136136 }
137137
138138 fn flush ( & mut self ) -> io:: Result < ( ) > {
139139 match * self {
140140 InternalStream :: Tcp ( ref mut s) => s. flush ( ) ,
141- #[ cfg( any( feature = "unix_socket" , all( unix, feature = "nightly" ) ) ) ]
141+ #[ cfg( any( feature = "with- unix_socket" , all( unix, feature = "nightly" ) ) ) ]
142142 InternalStream :: Unix ( ref mut s) => s. flush ( ) ,
143143 }
144144 }
@@ -150,7 +150,7 @@ fn open_socket(params: &ConnectParams) -> Result<InternalStream, ConnectError> {
150150 ConnectTarget :: Tcp ( ref host) => {
151151 Ok ( try!( TcpStream :: connect ( & ( & * * host, port) ) . map ( InternalStream :: Tcp ) ) )
152152 }
153- #[ cfg( any( feature = "unix_socket" , all( unix, feature = "nightly" ) ) ) ]
153+ #[ cfg( any( feature = "with- unix_socket" , all( unix, feature = "nightly" ) ) ) ]
154154 ConnectTarget :: Unix ( ref path) => {
155155 let path = path. join ( & format ! ( ".s.PGSQL.{}" , port) ) ;
156156 Ok ( try!( UnixStream :: connect ( & path) . map ( InternalStream :: Unix ) ) )
@@ -184,7 +184,7 @@ pub fn initialize_stream(params: &ConnectParams,
184184 // Postgres doesn't support SSL over unix sockets
185185 let host = match params. target {
186186 ConnectTarget :: Tcp ( ref host) => host,
187- #[ cfg( any( feature = "unix_socket" , all( unix, feature = "nightly" ) ) ) ]
187+ #[ cfg( any( feature = "with- unix_socket" , all( unix, feature = "nightly" ) ) ) ]
188188 ConnectTarget :: Unix ( _) => return Err ( ConnectError :: Io ( :: bad_response ( ) ) ) ,
189189 } ;
190190
0 commit comments