From e3a5ae6757c95984dd316862a8088b7142a7d066 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 20 May 2024 16:21:41 -0500 Subject: [PATCH] additional feedback from Matt --- build/fpga-regmap/src/lib.rs | 4 +--- drv/transceivers-server/src/main.rs | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/build/fpga-regmap/src/lib.rs b/build/fpga-regmap/src/lib.rs index 502e6dada..639ddecbd 100644 --- a/build/fpga-regmap/src/lib.rs +++ b/build/fpga-regmap/src/lib.rs @@ -173,9 +173,7 @@ fn write_reg_fields( writeln!( output, " -{prefix} use zerocopy::AsBytes; -{prefix} #[derive(Copy, Clone, Eq, PartialEq, AsBytes)] -{prefix} #[repr(C)] +{prefix} #[derive(Copy, Clone, Eq, PartialEq)] {prefix} #[allow(dead_code)] {prefix} pub enum {encode_name} {{" ) diff --git a/drv/transceivers-server/src/main.rs b/drv/transceivers-server/src/main.rs index 2f2195855..2618526a3 100644 --- a/drv/transceivers-server/src/main.rs +++ b/drv/transceivers-server/src/main.rs @@ -272,7 +272,7 @@ impl ServerImpl { // - SFF-8636 rev 2.10a, Section 6.2.4 Ok(Celsius(out.temperature.get() as f32 / 256.0)) } else { - Err(FpgaError::ImplError(status.error.as_bytes()[0])) + Err(FpgaError::ImplError(status.error as u8)) } } @@ -301,7 +301,7 @@ impl ServerImpl { } else { // TODO: how should we handle this? // Right now, we'll retry on the next pass through the loop. - Err(FpgaError::ImplError(status.error.as_bytes()[0])) + Err(FpgaError::ImplError(status.error as u8)) } }