@@ -222,7 +222,7 @@ impl AddressFamily {
222
222
}
223
223
}
224
224
225
- #[ derive( Copy ) ]
225
+ #[ derive( Clone , Copy ) ]
226
226
pub enum InetAddr {
227
227
V4 ( libc:: sockaddr_in ) ,
228
228
V6 ( libc:: sockaddr_in6 ) ,
@@ -348,12 +348,6 @@ impl hash::Hash for InetAddr {
348
348
}
349
349
}
350
350
351
- impl Clone for InetAddr {
352
- fn clone ( & self ) -> InetAddr {
353
- * self
354
- }
355
- }
356
-
357
351
impl fmt:: Display for InetAddr {
358
352
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
359
353
match * self {
@@ -421,7 +415,7 @@ impl fmt::Display for IpAddr {
421
415
*
422
416
*/
423
417
424
- #[ derive( Copy ) ]
418
+ #[ derive( Clone , Copy ) ]
425
419
pub struct Ipv4Addr ( pub libc:: in_addr ) ;
426
420
427
421
impl Ipv4Addr {
@@ -469,12 +463,6 @@ impl hash::Hash for Ipv4Addr {
469
463
}
470
464
}
471
465
472
- impl Clone for Ipv4Addr {
473
- fn clone ( & self ) -> Ipv4Addr {
474
- * self
475
- }
476
- }
477
-
478
466
impl fmt:: Display for Ipv4Addr {
479
467
fn fmt ( & self , fmt : & mut fmt:: Formatter ) -> fmt:: Result {
480
468
let octets = self . octets ( ) ;
@@ -550,7 +538,7 @@ impl fmt::Display for Ipv6Addr {
550
538
/// does not require that `sun_len` include the terminating null even for normal
551
539
/// sockets. Note that the actual sockaddr length is greater by
552
540
/// `offset_of!(libc::sockaddr_un, sun_path)`
553
- #[ derive( Copy ) ]
541
+ #[ derive( Clone , Copy ) ]
554
542
pub struct UnixAddr ( pub libc:: sockaddr_un , pub usize ) ;
555
543
556
544
impl UnixAddr {
@@ -657,12 +645,6 @@ impl hash::Hash for UnixAddr {
657
645
}
658
646
}
659
647
660
- impl Clone for UnixAddr {
661
- fn clone ( & self ) -> UnixAddr {
662
- * self
663
- }
664
- }
665
-
666
648
impl fmt:: Display for UnixAddr {
667
649
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
668
650
if self . 1 == 0 {
@@ -683,7 +665,7 @@ impl fmt::Display for UnixAddr {
683
665
*/
684
666
685
667
/// Represents a socket address
686
- #[ derive( Copy ) ]
668
+ #[ derive( Clone , Copy ) ]
687
669
pub enum SockAddr {
688
670
Inet ( InetAddr ) ,
689
671
Unix ( UnixAddr ) ,
@@ -802,12 +784,6 @@ impl hash::Hash for SockAddr {
802
784
}
803
785
}
804
786
805
- impl Clone for SockAddr {
806
- fn clone ( & self ) -> SockAddr {
807
- * self
808
- }
809
- }
810
-
811
787
impl fmt:: Display for SockAddr {
812
788
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
813
789
match * self {
0 commit comments