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;
21
21
use sys:: net:: netc as c;
22
22
use sys_common:: { FromInner , AsInner , IntoInner } ;
23
23
use vec;
24
+ use iter;
25
+ use slice;
24
26
25
27
/// Representation of a socket address for networking applications.
26
28
///
@@ -457,6 +459,15 @@ impl ToSocketAddrs for str {
457
459
}
458
460
}
459
461
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
+
460
471
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
461
472
impl < ' a , T : ToSocketAddrs + ?Sized > ToSocketAddrs for & ' a T {
462
473
type Iter = T :: Iter ;
You can’t perform that action at this time.
0 commit comments