From d43f24f573c1662ad18fc0f002f23e5618cd247c Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Tue, 24 May 2022 17:09:34 -0400 Subject: [PATCH] Switch back to automatic Debug derive for Header struct The `Header` `Debug` implementation was accidentally printing the `size` field for the `signature`. Rather than just fix that field, switch the whole thing back to using `derive(Debug)`. This adds in the `_reserved` field, which probably doesn't matter much either way but might as well show the whole struct when debug printing. --- src/table/header.rs | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/table/header.rs b/src/table/header.rs index c9cc581e6..af449fe4d 100644 --- a/src/table/header.rs +++ b/src/table/header.rs @@ -1,7 +1,7 @@ use super::Revision; -use core::fmt::{Debug, Formatter}; /// All standard UEFI tables begin with a common header. +#[derive(Debug)] #[repr(C)] pub struct Header { /// Unique identifier for this table. @@ -16,14 +16,3 @@ pub struct Header { /// Reserved field that must be set to 0. _reserved: u32, } - -impl Debug for Header { - fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result { - f.debug_struct("Header") - .field("signature", &(self.size as *const u64)) - .field("revision", &self.revision) - .field("size", &self.size) - .field("crc", &self.crc) - .finish() - } -}