@@ -420,13 +420,13 @@ async fn check_port(
420420 host : String , // The host name
421421 timeout : Duration , // The timeout duration for the TCP connection
422422) -> ( String , String ) {
423- let https_with_port = String :: from ( format ! ( "{}{}:{}" , "https://" , host, port) ) ; // Construct the HTTPS URL with the port
424- let http_with_port = String :: from ( format ! ( "{}{}:{}" , "http://" , host, port) ) ; // Construct the HTTP URL with the port
423+ let https_with_port = format ! ( "{}{}:{}" , "https://" , host, port) ; // Construct the HTTPS URL with the port
424+ let http_with_port = format ! ( "{}{}:{}" , "http://" , host, port) ; // Construct the HTTP URL with the port
425425 if port == 80 {
426426 let socket_address = SocketAddr :: new ( ip_addr. clone ( ) , port) ; // Create a socket address using the IP address and port
427427
428428 // If the TCP connection is successful, print the HTTP URL with the port
429- let ip = String :: from ( format ! ( "{}{}:{}" , "http://" , ip_addr. to_string( ) , port) ) ;
429+ let ip = format ! ( "{}{}:{}" , "http://" , ip_addr. to_string( ) , port) ;
430430
431431 match tokio:: time:: timeout ( timeout, TcpStream :: connect ( & socket_address) ) . await {
432432 Ok ( Ok ( _) ) => {
@@ -439,7 +439,7 @@ async fn check_port(
439439 }
440440 } else if port == 443 {
441441 // If the TCP connection is successful, print the HTTPS URL with the port
442- let ip = String :: from ( format ! ( "{}{}:{}" , "https://" , ip_addr. to_string( ) , port) ) ;
442+ let ip = format ! ( "{}{}:{}" , "https://" , ip_addr. to_string( ) , port) ;
443443
444444 let socket_address = SocketAddr :: new ( ip_addr. clone ( ) , port) ; // Create a socket address using the IP address and port
445445
@@ -454,7 +454,7 @@ async fn check_port(
454454 }
455455 } else {
456456 // If the TCP connection is successful, print the HTTPS URL with the port
457- let ip = String :: from ( format ! ( "{}{}:{}" , "https://" , ip_addr. to_string( ) , port) ) ;
457+ let ip = format ! ( "{}{}:{}" , "https://" , ip_addr. to_string( ) , port) ;
458458
459459 let socket_address = SocketAddr :: new ( ip_addr. clone ( ) , port) ; // Create a socket address using the IP address and port
460460
0 commit comments