Skip to content

Commit 310d205

Browse files
author
Bryant Mairs
committed
Add derives for more enums
1 parent c25f551 commit 310d205

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/sys/epoll.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ libc_bitflags!(
2828
}
2929
);
3030

31-
#[derive(Clone, Copy, Eq, PartialEq)]
31+
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
3232
#[repr(i32)]
3333
pub enum EpollOp {
3434
EpollCtlAdd = libc::EPOLL_CTL_ADD,

src/sys/socket/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ pub enum SockType {
7777
/// Constants used in [`socket`](fn.socket.html) and [`socketpair`](fn.socketpair.html)
7878
/// to specify the protocol to use.
7979
#[repr(i32)]
80+
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
8081
pub enum SockProtocol {
8182
/// TCP protocol ([ip(7)](http://man7.org/linux/man-pages/man7/ip.7.html))
8283
Tcp = libc::IPPROTO_TCP,
@@ -857,13 +858,14 @@ pub fn send(fd: RawFd, buf: &[u8], flags: MsgFlags) -> Result<usize> {
857858
///
858859
/// [Further reading](http://pubs.opengroup.org/onlinepubs/9699919799/functions/setsockopt.html)
859860
#[repr(i32)]
861+
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
860862
pub enum SockLevel {
861863
Socket = libc::SOL_SOCKET,
862864
Tcp = libc::IPPROTO_TCP,
863865
Ip = libc::IPPROTO_IP,
864866
Ipv6 = libc::IPPROTO_IPV6,
865867
Udp = libc::IPPROTO_UDP,
866-
#[cfg(any(target_os = "linux", target_os = "android"))]
868+
#[cfg(any(target_os = "android", target_os = "linux"))]
867869
Netlink = libc::SOL_NETLINK,
868870
}
869871

@@ -970,7 +972,7 @@ pub unsafe fn sockaddr_storage_to_addr(
970972
}
971973

972974

973-
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
975+
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
974976
pub enum Shutdown {
975977
/// Further receptions will be disallowed.
976978
Read,

0 commit comments

Comments
 (0)