File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -768,20 +768,19 @@ impl rustls_client_config {
768768 }
769769 CStr :: from_ptr( server_name)
770770 } ;
771- let config = try_clone_arc!( config) ;
772- let conn_out = try_mut_from_ptr_ptr!( conn_out) ;
773-
774771 let Ok ( server_name) = server_name. to_str( ) else {
775772 return rustls_result:: InvalidDnsNameError ;
776773 } ;
777- let Ok ( server_name) = server_name. try_into( ) else { return rustls_result:: InvalidDnsNameError ; }
778- let client = ClientConnection :: new( config, server_name) . unwrap( ) ;
779-
780- // We've succeeded. Put the client on the heap, and transfer ownership
781- // to the caller. After this point, we must return rustls_result::Ok so the
782- // caller knows it is responsible for this memory.
783- let c = Connection :: from_client( client) ;
784- set_boxed_mut_ptr( conn_out, c) ;
774+ let Ok ( server_name) = server_name. try_into( ) else {
775+ return rustls_result:: InvalidDnsNameError ;
776+ } ;
777+
778+ set_boxed_mut_ptr(
779+ try_mut_from_ptr_ptr!( conn_out) ,
780+ Connection :: from_client(
781+ ClientConnection :: new( try_clone_arc!( config) , server_name) . unwrap( ) ,
782+ ) ,
783+ ) ;
785784 rustls_result:: Ok
786785 }
787786 }
You can’t perform that action at this time.
0 commit comments