Skip to content

Commit 736abd8

Browse files
committed
Fix clippy
1 parent 73b05a5 commit 736abd8

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

dstack-attest/src/attestation.rs

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
77
use std::{borrow::Cow, time::SystemTime};
88

9-
use anyhow::{Context, Result, anyhow, bail};
9+
use anyhow::{anyhow, bail, Context, Result};
1010
use cc_eventlog::{RuntimeEvent, TdxEvent};
1111
use dcap_qvl::{
1212
quote::{EnclaveReport, Quote, Report, TDReport10, TDReport15},
1313
verify::VerifiedReport as TdxVerifiedReport,
1414
};
1515
use dstack_types::{Platform, VmConfig};
16-
use ez_hash::{Hasher, Sha384, sha256};
16+
use ez_hash::{sha256, Hasher, Sha384};
1717
use or_panic::ResultOrPanic;
1818
use scale::{Decode, Encode};
1919
use serde::{Deserialize, Serialize};
@@ -173,6 +173,7 @@ impl QuoteContentType<'_> {
173173
}
174174
}
175175

176+
#[allow(clippy::large_enum_variant)]
176177
/// Represents a verified attestation
177178
#[derive(Clone)]
178179
pub enum DstackVerifiedReport {
@@ -264,8 +265,8 @@ impl AttestationQuote {
264265
pub fn mode(&self) -> AttestationMode {
265266
match self {
266267
AttestationQuote::DstackTdx { .. } => AttestationMode::DstackTdx,
267-
AttestationQuote::DstackGcpTdx { .. } => AttestationMode::DstackGcpTdx,
268-
AttestationQuote::DstackNitroEnclave { .. } => AttestationMode::DstackNitroEnclave,
268+
AttestationQuote::DstackGcpTdx => AttestationMode::DstackGcpTdx,
269+
AttestationQuote::DstackNitroEnclave => AttestationMode::DstackNitroEnclave,
269270
}
270271
}
271272
}
@@ -780,17 +781,13 @@ mod tests {
780781

781782
// Test invalid raw content length
782783
let invalid_content = [42u8; 65];
783-
assert!(
784-
content_type
785-
.to_report_data_with_hash(&invalid_content, "raw")
786-
.is_err()
787-
);
784+
assert!(content_type
785+
.to_report_data_with_hash(&invalid_content, "raw")
786+
.is_err());
788787

789788
// Test invalid hash algorithm
790-
assert!(
791-
content_type
792-
.to_report_data_with_hash(content, "invalid")
793-
.is_err()
794-
);
789+
assert!(content_type
790+
.to_report_data_with_hash(content, "invalid")
791+
.is_err());
795792
}
796793
}

0 commit comments

Comments
 (0)