From c50e987b4e169e2d7dc7089c91407e1e55c550f1 Mon Sep 17 00:00:00 2001 From: Bryant Mairs Date: Sun, 10 Mar 2019 08:29:23 -0700 Subject: Add extra traits for all types Derive Clone, Copy, Eq, Hash, and PartialEq for all types. Not all traits are supported by all types, which is why many are missing some. --- src/mqueue.rs | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'src/mqueue.rs') diff --git a/src/mqueue.rs b/src/mqueue.rs index 87be6532..b958b71c 100644 --- a/src/mqueue.rs +++ b/src/mqueue.rs @@ -29,22 +29,11 @@ libc_bitflags!{ } #[repr(C)] -#[derive(Clone, Copy)] -#[allow(missing_debug_implementations)] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] pub struct MqAttr { mq_attr: libc::mq_attr, } -impl PartialEq for MqAttr { - fn eq(&self, other: &MqAttr) -> bool { - let self_attr = self.mq_attr; - let other_attr = other.mq_attr; - self_attr.mq_flags == other_attr.mq_flags && self_attr.mq_maxmsg == other_attr.mq_maxmsg && - self_attr.mq_msgsize == other_attr.mq_msgsize && - self_attr.mq_curmsgs == other_attr.mq_curmsgs - } -} - impl MqAttr { pub fn new(mq_flags: c_long, mq_maxmsg: c_long, -- cgit v1.2.3