diff options
author | Bryant Mairs <bryant@mai.rs> | 2019-03-10 08:29:23 -0700 |
---|---|---|
committer | Bryant Mairs <bryant@mai.rs> | 2019-06-09 11:31:46 -0700 |
commit | c50e987b4e169e2d7dc7089c91407e1e55c550f1 (patch) | |
tree | 4892e791f8809dfa1501e9fa4ff999a106a8dd04 /src/mqueue.rs | |
parent | 2075ac70bdd4848b08213a237feb32f5506096e0 (diff) | |
download | nix-c50e987b4e169e2d7dc7089c91407e1e55c550f1.zip |
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.
Diffstat (limited to 'src/mqueue.rs')
-rw-r--r-- | src/mqueue.rs | 13 |
1 files changed, 1 insertions, 12 deletions
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<MqAttr> 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, |