Skip to content

Commit 900d42d

Browse files
tylerfanelliDGonzalezVillal
authored andcommitted
Fix clippy errors
Signed-off-by: Tyler Fanelli <tfanelli@redhat.com>
1 parent 07e666e commit 900d42d

2 files changed

Lines changed: 5 additions & 10 deletions

File tree

src/error.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ impl std::convert::From<std::io::Error> for UserApiError {
615615

616616
impl From<UserApiError> for io::Error {
617617
fn from(value: UserApiError) -> Self {
618-
io::Error::new(io::ErrorKind::Other, value)
618+
io::Error::other(value)
619619
}
620620
}
621621

@@ -742,7 +742,7 @@ impl std::fmt::Display for AttestationReportError {
742742

743743
impl From<AttestationReportError> for std::io::Error {
744744
fn from(value: AttestationReportError) -> Self {
745-
std::io::Error::new(std::io::ErrorKind::Other, value)
745+
std::io::Error::other(value)
746746
}
747747
}
748748

src/firmware/host/types/snp.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,12 @@ impl BitOrAssign for SnpPlatformStatusFlags {
4848
}
4949

5050
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
51-
#[derive(Clone, Debug, PartialEq, Eq)]
51+
#[derive(Clone, Debug, Default, PartialEq, Eq)]
5252
#[repr(C)]
5353
/// Certificates which are accepted for [CertTableEntry](self::CertTableEntry)
5454
pub enum CertType {
5555
/// Empty or closing entry for the CertTable
56+
#[default]
5657
Empty,
5758

5859
/// AMD Root Signing Key (ARK) certificate
@@ -74,12 +75,6 @@ pub enum CertType {
7475
OTHER(uuid::Uuid),
7576
}
7677

77-
impl Default for CertType {
78-
fn default() -> Self {
79-
Self::Empty
80-
}
81-
}
82-
8378
impl Display for CertType {
8479
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
8580
let guid = match self {
@@ -273,7 +268,7 @@ impl Ord for CertTableEntry {
273268

274269
impl PartialOrd for CertTableEntry {
275270
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
276-
Some(self.cert_type.cmp(&other.cert_type))
271+
Some(self.cmp(other))
277272
}
278273
}
279274

0 commit comments

Comments
 (0)