@@ -7,6 +7,7 @@ use std::{io, thread};
7
7
8
8
use futures_util:: future:: TryFutureExt ;
9
9
use lazy_static:: lazy_static;
10
+ use pki_types:: ServerName ;
10
11
use rustls:: ClientConfig ;
11
12
use tokio:: io:: { copy, split, AsyncReadExt , AsyncWriteExt } ;
12
13
use tokio:: net:: { TcpListener , TcpStream } ;
@@ -64,7 +65,7 @@ lazy_static! {
64
65
async fn start_client ( addr : SocketAddr , domain : & str , config : Arc < ClientConfig > ) -> io:: Result < ( ) > {
65
66
const FILE : & [ u8 ] = include_bytes ! ( "../README.md" ) ;
66
67
67
- let domain = pki_types :: ServerName :: try_from ( domain) . unwrap ( ) . to_owned ( ) ;
68
+ let domain = ServerName :: try_from ( domain) . unwrap ( ) . to_owned ( ) ;
68
69
let config = TlsConnector :: from ( config) ;
69
70
let mut buf = vec ! [ 0 ; FILE . len( ) ] ;
70
71
@@ -112,9 +113,7 @@ async fn test_lazy_config_acceptor() -> io::Result<()> {
112
113
let ( sconfig, cconfig) = utils:: make_configs ( ) ;
113
114
114
115
let ( cstream, sstream) = tokio:: io:: duplex ( 1200 ) ;
115
- let domain = pki_types:: ServerName :: try_from ( "foobar.com" )
116
- . unwrap ( )
117
- . to_owned ( ) ;
116
+ let domain = ServerName :: try_from ( "foobar.com" ) . unwrap ( ) . to_owned ( ) ;
118
117
tokio:: spawn ( async move {
119
118
let connector = crate :: TlsConnector :: from ( Arc :: new ( cconfig) ) ;
120
119
let mut client = connector. connect ( domain, cstream) . await . unwrap ( ) ;
0 commit comments