Skip to content

Commit 8e31c6a

Browse files
andreeafloresculauralt
authored andcommitted
derive Eq for structs that derive PartialEq
This solves the clippy warnings generated from switching to a newer Rust version. Signed-off-by: Andreea Florescu <fandree@amazon.com>
1 parent 56f8644 commit 8e31c6a

File tree

9 files changed

+14
-14
lines changed

9 files changed

+14
-14
lines changed

src/cmdline/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use std::result;
1414
use vm_memory::{Address, GuestAddress, GuestUsize};
1515

1616
/// The error type for command line building operations.
17-
#[derive(Debug, PartialEq)]
17+
#[derive(Debug, PartialEq, Eq)]
1818
pub enum Error {
1919
/// Operation would have resulted in a non-printable ASCII character.
2020
InvalidAscii,

src/configurator/aarch64/fdt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use std::fmt;
1111
use crate::configurator::{BootConfigurator, BootParams, Error as BootConfiguratorError, Result};
1212

1313
/// Errors specific to the device tree boot protocol configuration.
14-
#[derive(Debug, PartialEq)]
14+
#[derive(Debug, PartialEq, Eq)]
1515
pub enum Error {
1616
/// FDT does not fit in guest memory.
1717
FDTPastRamEnd,

src/configurator/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ use std::cmp::max;
3535
use std::mem::size_of;
3636

3737
/// Errors specific to boot protocol configuration.
38-
#[derive(Debug, PartialEq)]
38+
#[derive(Debug, PartialEq, Eq)]
3939
pub enum Error {
4040
/// Errors specific to the Linux boot protocol configuration.
4141
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
@@ -433,28 +433,28 @@ mod tests {
433433

434434
unsafe impl ByteValued for Foobar {}
435435

436-
#[derive(Clone, Copy, Debug, Default, PartialEq)]
436+
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
437437
struct DummyHeader {
438438
_dummy: u64,
439439
}
440440

441441
unsafe impl ByteValued for DummyHeader {}
442442

443-
#[derive(Clone, Copy, Debug, Default, PartialEq)]
443+
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
444444
struct DummySection {
445445
_dummy: u64,
446446
}
447447

448448
unsafe impl ByteValued for DummySection {}
449449

450-
#[derive(Clone, Copy, Debug, Default, PartialEq)]
450+
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
451451
struct DummyModule {
452452
_dummy: u64,
453453
}
454454

455455
unsafe impl ByteValued for DummyModule {}
456456

457-
#[derive(Clone, Copy, Debug, Default, PartialEq)]
457+
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
458458
struct OtherDummyModule {
459459
_dummy: u64,
460460
}

src/configurator/x86_64/linux.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use std::fmt;
2222
pub struct LinuxBootConfigurator {}
2323

2424
/// Errors specific to the Linux boot protocol configuration.
25-
#[derive(Debug, PartialEq)]
25+
#[derive(Debug, PartialEq, Eq)]
2626
pub enum Error {
2727
/// The zero page extends past the end of guest memory.
2828
ZeroPagePastRamEnd,

src/configurator/x86_64/pvh.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use std::fmt;
2525
pub struct PvhBootConfigurator {}
2626

2727
/// Errors specific to the PVH boot protocol configuration.
28-
#[derive(Debug, PartialEq)]
28+
#[derive(Debug, PartialEq, Eq)]
2929
pub enum Error {
3030
/// The starting address for the memory map wasn't passed to the boot configurator.
3131
MemmapTableAddressMissing,

src/loader/aarch64/pe/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub struct PE;
2525

2626
unsafe impl ByteValued for arm64_image_header {}
2727

28-
#[derive(Debug, PartialEq)]
28+
#[derive(Debug, PartialEq, Eq)]
2929
/// PE kernel loader errors.
3030
pub enum Error {
3131
/// Unable to seek to Image end.

src/loader/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ mod aarch64;
4141
#[cfg(target_arch = "aarch64")]
4242
pub use aarch64::*;
4343

44-
#[derive(Debug, PartialEq)]
44+
#[derive(Debug, PartialEq, Eq)]
4545
/// Kernel loader errors.
4646
pub enum Error {
4747
/// Failed to load bzimage.

src/loader/x86_64/bzimage/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use super::super::{
2121
bootparam, Error as KernelLoaderError, KernelLoader, KernelLoaderResult, Result,
2222
};
2323

24-
#[derive(Debug, PartialEq)]
24+
#[derive(Debug, PartialEq, Eq)]
2525
/// Bzimage kernel loader errors.
2626
pub enum Error {
2727
/// Invalid bzImage binary.

src/loader/x86_64/elf/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ unsafe impl ByteValued for elf::Elf64_Ehdr {}
2727
unsafe impl ByteValued for elf::Elf64_Nhdr {}
2828
unsafe impl ByteValued for elf::Elf64_Phdr {}
2929

30-
#[derive(Debug, PartialEq)]
30+
#[derive(Debug, PartialEq, Eq)]
3131
/// Elf kernel loader errors.
3232
pub enum Error {
3333
/// Invalid alignment.
@@ -96,7 +96,7 @@ impl fmt::Display for Error {
9696

9797
impl std::error::Error for Error {}
9898

99-
#[derive(Clone, Copy, Debug, PartialEq)]
99+
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
100100
/// Availability of PVH entry point in the kernel, which allows the VMM
101101
/// to use the PVH boot protocol to start guests.
102102
pub enum PvhBootCapability {

0 commit comments

Comments
 (0)