File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -511,21 +511,19 @@ mod endpoint_tests {
511511
512512	#[ test]  
513513	fn  convert_to_socket_addrs ( )  { 
514- 		let  endpoint = HttpEndpoint :: for_host ( "foo.com " . into ( ) ) ; 
514+ 		let  endpoint = HttpEndpoint :: for_host ( "localhost " . into ( ) ) ; 
515515		let  host = endpoint. host ( ) ; 
516516		let  port = endpoint. port ( ) ; 
517517
518518		use  std:: net:: ToSocketAddrs ; 
519519		match  ( & endpoint) . to_socket_addrs ( )  { 
520520			Err ( e)  => panic ! ( "Unexpected error: {:?}" ,  e) , 
521- 			Ok ( mut  socket_addrs)  => { 
522- 				match  socket_addrs. next ( )  { 
523- 					None  => panic ! ( "Expected socket address" ) , 
524- 					Some ( addr)  => { 
525- 						assert_eq ! ( addr,  ( host,  port) . to_socket_addrs( ) . unwrap( ) . next( ) . unwrap( ) ) ; 
526- 						assert ! ( socket_addrs. next( ) . is_none( ) ) ; 
527- 					} 
521+ 			Ok ( socket_addrs)  => { 
522+ 				let  mut  std_addrs = ( host,  port) . to_socket_addrs ( ) . unwrap ( ) ; 
523+ 				for  addr in  socket_addrs { 
524+ 					assert_eq ! ( addr,  std_addrs. next( ) . unwrap( ) ) ; 
528525				} 
526+ 				assert ! ( std_addrs. next( ) . is_none( ) ) ; 
529527			} 
530528		} 
531529	} 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments