Skip to content

Commit dca6a90

Browse files
committed
fix: use or_panic instead of expect, fix formatting
1 parent 011ab37 commit dca6a90

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

dstack-attest/src/attestation.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -355,15 +355,13 @@ pub enum VersionedAttestation {
355355

356356
impl Encode for VersionedAttestation {
357357
fn size_hint(&self) -> usize {
358-
self.to_bytes()
359-
.map(|b| b.len())
360-
.unwrap_or(0)
358+
self.to_bytes().map(|b| b.len()).unwrap_or(0)
361359
}
362360

363361
fn encode_to<T: Output + ?Sized>(&self, dest: &mut T) {
364362
let bytes = self
365363
.to_bytes()
366-
.expect("VersionedAttestation should always encode successfully");
364+
.or_panic("VersionedAttestation should always encode successfully");
367365
dest.write(&bytes);
368366
}
369367
}

0 commit comments

Comments
 (0)