diff --git a/src/header.rs b/src/header.rs index efb0dc7..696fd42 100644 --- a/src/header.rs +++ b/src/header.rs @@ -41,7 +41,7 @@ pub enum ModeError { } /// Wrapper around the UNIX file permissions given in octal ASCII. -#[derive(Copy, Clone)] +#[derive(Copy, Clone, PartialEq, Eq)] #[repr(transparent)] pub struct Mode(TarFormatOctal<8>); @@ -72,8 +72,7 @@ impl Debug for Mode { /// This is also mostly compatible with the "Ustar"-header and the "GNU format". /// Because this library only needs to fetch data and filename, we don't need /// further checks. -// TODO make PartialEq? -#[derive(Debug, Copy, Clone)] +#[derive(Debug, Copy, Clone, PartialEq, Eq)] #[repr(C, packed)] pub struct PosixHeader { pub name: TarFormatString, diff --git a/src/tar_format_types.rs b/src/tar_format_types.rs index 7630b67..53d51c2 100644 --- a/src/tar_format_types.rs +++ b/src/tar_format_types.rs @@ -15,7 +15,7 @@ use num_traits::Num; /// /// The content is likely to be UTF-8/ASCII, but that is not verified by this /// type. The -#[derive(Copy, Clone)] +#[derive(Copy, Clone, PartialEq, Eq)] #[repr(C)] pub struct TarFormatString { bytes: [u8; N], @@ -83,17 +83,17 @@ impl Debug for TarFormatString { } /// A number with a specified base. Trailing spaces in the string are ignored. -#[derive(Copy, Clone)] +#[derive(Copy, Clone, PartialEq, Eq)] #[repr(C)] pub struct TarFormatNumber(TarFormatString); /// An octal number. Trailing spaces in the string are ignored. -#[derive(Copy, Clone)] +#[derive(Copy, Clone, PartialEq, Eq)] #[repr(C)] pub struct TarFormatOctal(TarFormatNumber); /// A decimal number. Trailing spaces in the string are ignored. -#[derive(Copy, Clone)] +#[derive(Copy, Clone, PartialEq, Eq)] #[repr(C)] pub struct TarFormatDecimal(TarFormatNumber);