From 9962db4ecf227792d777ff0bc91d9e4d50d24f85 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Fri, 23 Sep 2022 13:29:33 +0200 Subject: Suppress compiler warnings This commit adds the allow(unused) attribute to functions and constants that are not currently used. There is one warning remaining but https://github.com/embassy-rs/cyw43/pull/23 attempts to address that one. The constants have been moved into a module to allow the attribute to be applied to the module as a whole. The motivation for this is that it will hopefully make it easier to spot new warnings that might be introduced by new, or updated code. --- src/structs.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/structs.rs') diff --git a/src/structs.rs b/src/structs.rs index 355470971..ed5fc18df 100644 --- a/src/structs.rs +++ b/src/structs.rs @@ -5,10 +5,12 @@ macro_rules! impl_bytes { impl $t { pub const SIZE: usize = core::mem::size_of::(); + #[allow(unused)] pub fn to_bytes(&self) -> [u8; Self::SIZE] { unsafe { core::mem::transmute(*self) } } + #[allow(unused)] pub fn from_bytes(bytes: &[u8; Self::SIZE]) -> Self { unsafe { core::mem::transmute(*bytes) } } @@ -167,6 +169,7 @@ pub struct DownloadHeader { } impl_bytes!(DownloadHeader); +#[allow(unused)] pub const DOWNLOAD_FLAG_NO_CRC: u16 = 0x0001; pub const DOWNLOAD_FLAG_BEGIN: u16 = 0x0002; pub const DOWNLOAD_FLAG_END: u16 = 0x0004; -- cgit