File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -176,7 +176,6 @@ pub struct Connector {
176
176
177
177
impl Connector {
178
178
#[ cfg( feature = "tls" ) ]
179
- #[ allow( dead_code) ]
180
179
pub fn new ( ) -> Self {
181
180
Self { tls : None , timeout : Duration :: from_secs ( 10 ) }
182
181
}
@@ -210,7 +209,7 @@ impl Connector {
210
209
if endpoint. tls {
211
210
#[ cfg( feature = "tls" ) ]
212
211
if self . tls . is_none ( ) {
213
- return Err ( Error :: new ( ErrorKind :: Unsupported , "tls not supported " ) ) ;
212
+ return Err ( Error :: new ( ErrorKind :: Unsupported , "tls not configured " ) ) ;
214
213
}
215
214
#[ cfg( not( feature = "tls" ) ) ]
216
215
return Err ( Error :: new ( ErrorKind :: Unsupported , "tls not supported" ) ) ;
Original file line number Diff line number Diff line change @@ -130,7 +130,10 @@ impl Builder {
130
130
return Err ( Error :: BadArguments ( & "connection timeout must not be negative" ) ) ;
131
131
}
132
132
#[ cfg( feature = "tls" ) ]
133
- let connector = Connector :: with_tls ( self . tls . unwrap_or_default ( ) . into_config ( ) ?) ;
133
+ let connector = match self . tls {
134
+ Some ( options) => Connector :: with_tls ( options. into_config ( ) ?) ,
135
+ None => Connector :: new ( ) ,
136
+ } ;
134
137
#[ cfg( not( feature = "tls" ) ) ]
135
138
let connector = Connector :: new ( ) ;
136
139
let ( state_sender, state_receiver) = asyncs:: sync:: watch:: channel ( SessionState :: Disconnected ) ;
You can’t perform that action at this time.
0 commit comments