summaryrefslogtreecommitdiff
path: root/src/sys/socket/addr.rs
diff options
context:
space:
mode:
authorBryant Mairs <bryantmairs@google.com>2017-12-16 09:48:35 -0800
committerBryant Mairs <bryantmairs@google.com>2017-12-20 07:05:04 -0800
commit86d1801922cd6532d17939abad17db191db5c752 (patch)
treeec955cd50540ab2d75556c76078eba32ef3a3d82 /src/sys/socket/addr.rs
parentb4a7983288ad53812ac84a7f6196071600d39ec7 (diff)
downloadnix-86d1801922cd6532d17939abad17db191db5c752.zip
Remove unnecessary impl Clones
Diffstat (limited to 'src/sys/socket/addr.rs')
-rw-r--r--src/sys/socket/addr.rs32
1 files changed, 4 insertions, 28 deletions
diff --git a/src/sys/socket/addr.rs b/src/sys/socket/addr.rs
index 0130d2c0..dd2ae17d 100644
--- a/src/sys/socket/addr.rs
+++ b/src/sys/socket/addr.rs
@@ -222,7 +222,7 @@ impl AddressFamily {
}
}
-#[derive(Copy)]
+#[derive(Clone, Copy)]
pub enum InetAddr {
V4(libc::sockaddr_in),
V6(libc::sockaddr_in6),
@@ -348,12 +348,6 @@ impl hash::Hash for InetAddr {
}
}
-impl Clone for InetAddr {
- fn clone(&self) -> InetAddr {
- *self
- }
-}
-
impl fmt::Display for InetAddr {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
@@ -421,7 +415,7 @@ impl fmt::Display for IpAddr {
*
*/
-#[derive(Copy)]
+#[derive(Clone, Copy)]
pub struct Ipv4Addr(pub libc::in_addr);
impl Ipv4Addr {
@@ -469,12 +463,6 @@ impl hash::Hash for Ipv4Addr {
}
}
-impl Clone for Ipv4Addr {
- fn clone(&self) -> Ipv4Addr {
- *self
- }
-}
-
impl fmt::Display for Ipv4Addr {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
let octets = self.octets();
@@ -550,7 +538,7 @@ impl fmt::Display for Ipv6Addr {
/// does not require that `sun_len` include the terminating null even for normal
/// sockets. Note that the actual sockaddr length is greater by
/// `offset_of!(libc::sockaddr_un, sun_path)`
-#[derive(Copy)]
+#[derive(Clone, Copy)]
pub struct UnixAddr(pub libc::sockaddr_un, pub usize);
impl UnixAddr {
@@ -657,12 +645,6 @@ impl hash::Hash for UnixAddr {
}
}
-impl Clone for UnixAddr {
- fn clone(&self) -> UnixAddr {
- *self
- }
-}
-
impl fmt::Display for UnixAddr {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
if self.1 == 0 {
@@ -683,7 +665,7 @@ impl fmt::Display for UnixAddr {
*/
/// Represents a socket address
-#[derive(Copy)]
+#[derive(Clone, Copy)]
pub enum SockAddr {
Inet(InetAddr),
Unix(UnixAddr),
@@ -802,12 +784,6 @@ impl hash::Hash for SockAddr {
}
}
-impl Clone for SockAddr {
- fn clone(&self) -> SockAddr {
- *self
- }
-}
-
impl fmt::Display for SockAddr {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {