Derive Clone for IpAddr and SocketAddr

This commit is contained in:
Eric Reed 2013-08-08 16:56:04 -07:00
parent 4bdceb9c00
commit 97555e865c

View File

@ -17,7 +17,7 @@ use option::{Option, None, Some};
type Port = u16;
#[deriving(Eq, TotalEq)]
#[deriving(Eq, TotalEq, Clone)]
pub enum IpAddr {
Ipv4Addr(u8, u8, u8, u8),
Ipv6Addr(u16, u16, u16, u16, u16, u16, u16, u16)
@ -62,7 +62,7 @@ impl ToStr for IpAddr {
}
}
#[deriving(Eq, TotalEq)]
#[deriving(Eq, TotalEq, Clone)]
pub struct SocketAddr {
ip: IpAddr,
port: Port,