From 1ad76b1299ac9c097a4a059c543cae02e1a4ffc1 Mon Sep 17 00:00:00 2001 From: Tyler Fanelli Date: Mon, 31 Jul 2023 20:58:47 -0400 Subject: [PATCH] report: Remove write_hex We can just serialize the raw bytes into a file, rather than write them in hexadecimal. Signed-off-by: Tyler Fanelli --- src/report.rs | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/report.rs b/src/report.rs index a7db338..a4c0133 100644 --- a/src/report.rs +++ b/src/report.rs @@ -30,22 +30,6 @@ pub fn create_random_request() -> [u8; 64] { data } -// Write data into given file. Split it into 16 byte lines. -pub fn write_hex(file: &mut BufWriter, data: &[u8]) -> Result<()> { - let mut line_counter = 0; - for val in data { - // Make it blocks for easier read - if line_counter.eq(&16) { - writeln!(file).context("Failed to write data to file")?; - line_counter = 0; - } - // Write byte into file - write!(file, "{:02x}", val).context("Failed to write data to file")?; - line_counter += 1; - } - Ok(()) -} - #[derive(StructOpt)] pub struct ReportArgs { #[structopt(help = "File to write the attestation report to.")]