From b0be48424e81384de3280b5a5ac521d694b82e15 Mon Sep 17 00:00:00 2001 From: Brian Cully Date: Fri, 9 Aug 2019 19:50:46 -0400 Subject: Add PartialEq derives for USB descriptors. --- src/descriptor.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/descriptor.rs b/src/descriptor.rs index 9068c15..f49259f 100644 --- a/src/descriptor.rs +++ b/src/descriptor.rs @@ -1,6 +1,6 @@ use core::convert::TryFrom; -#[derive(Clone, Copy, Debug)] +#[derive(Clone, Copy, Debug, PartialEq)] pub enum DescriptorType { Device = 1, Configuration = 2, @@ -30,7 +30,7 @@ impl TryFrom for DescriptorType { } } -#[derive(Copy, Clone, Debug)] +#[derive(Copy, Clone, Debug, PartialEq)] #[repr(C, packed)] pub struct DeviceDescriptor { pub b_length: u8, @@ -49,7 +49,7 @@ pub struct DeviceDescriptor { pub b_num_configurations: u8, } -#[derive(Copy, Clone, Debug)] +#[derive(Copy, Clone, Debug, PartialEq)] #[repr(C, packed)] pub struct ConfigurationDescriptor { pub b_length: u8, @@ -62,7 +62,7 @@ pub struct ConfigurationDescriptor { pub b_max_power: u8, } -#[derive(Copy, Clone, Debug)] +#[derive(Copy, Clone, Debug, PartialEq)] #[repr(C, packed)] pub struct InterfaceDescriptor { pub b_length: u8, @@ -76,7 +76,7 @@ pub struct InterfaceDescriptor { pub i_interface: u8, } -#[derive(Copy, Clone, Debug)] +#[derive(Copy, Clone, Debug, PartialEq)] #[repr(C, packed)] pub struct EndpointDescriptor { pub b_length: u8, -- cgit v1.2.3