File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ use option;
2121use sys:: net:: netc as c;
2222use sys_common:: { FromInner , AsInner , IntoInner } ;
2323use vec;
24+ use iter;
25+ use slice;
2426
2527/// Representation of a socket address for networking applications.
2628///
@@ -457,6 +459,15 @@ impl ToSocketAddrs for str {
457459 }
458460}
459461
462+ #[ stable( feature = "slice_to_socket_addrs" , since = "1.8.0" ) ]
463+ impl < ' a > ToSocketAddrs for & ' a [ SocketAddr ] {
464+ type Iter = iter:: Cloned < slice:: Iter < ' a , SocketAddr > > ;
465+
466+ fn to_socket_addrs ( & self ) -> io:: Result < Self :: Iter > {
467+ Ok ( self . iter ( ) . cloned ( ) )
468+ }
469+ }
470+
460471#[ stable( feature = "rust1" , since = "1.0.0" ) ]
461472impl < ' a , T : ToSocketAddrs + ?Sized > ToSocketAddrs for & ' a T {
462473 type Iter = T :: Iter ;
You can’t perform that action at this time.
0 commit comments