diff options
| author | Daniel Bevenius <[email protected]> | 2022-09-23 13:29:33 +0200 |
|---|---|---|
| committer | Daniel Bevenius <[email protected]> | 2022-09-26 14:08:50 +0200 |
| commit | 9962db4ecf227792d777ff0bc91d9e4d50d24f85 (patch) | |
| tree | 2358d183ffb04132695f8f478b18df392d634e60 /src/structs.rs | |
| parent | 79a9a4eb9898b4e56544f78729b6e8960c884960 (diff) | |
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.
Diffstat (limited to 'src/structs.rs')
| -rw-r--r-- | src/structs.rs | 3 |
1 files changed, 3 insertions, 0 deletions
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 { | |||
| 5 | impl $t { | 5 | impl $t { |
| 6 | pub const SIZE: usize = core::mem::size_of::<Self>(); | 6 | pub const SIZE: usize = core::mem::size_of::<Self>(); |
| 7 | 7 | ||
| 8 | #[allow(unused)] | ||
| 8 | pub fn to_bytes(&self) -> [u8; Self::SIZE] { | 9 | pub fn to_bytes(&self) -> [u8; Self::SIZE] { |
| 9 | unsafe { core::mem::transmute(*self) } | 10 | unsafe { core::mem::transmute(*self) } |
| 10 | } | 11 | } |
| 11 | 12 | ||
| 13 | #[allow(unused)] | ||
| 12 | pub fn from_bytes(bytes: &[u8; Self::SIZE]) -> Self { | 14 | pub fn from_bytes(bytes: &[u8; Self::SIZE]) -> Self { |
| 13 | unsafe { core::mem::transmute(*bytes) } | 15 | unsafe { core::mem::transmute(*bytes) } |
| 14 | } | 16 | } |
| @@ -167,6 +169,7 @@ pub struct DownloadHeader { | |||
| 167 | } | 169 | } |
| 168 | impl_bytes!(DownloadHeader); | 170 | impl_bytes!(DownloadHeader); |
| 169 | 171 | ||
| 172 | #[allow(unused)] | ||
| 170 | pub const DOWNLOAD_FLAG_NO_CRC: u16 = 0x0001; | 173 | pub const DOWNLOAD_FLAG_NO_CRC: u16 = 0x0001; |
| 171 | pub const DOWNLOAD_FLAG_BEGIN: u16 = 0x0002; | 174 | pub const DOWNLOAD_FLAG_BEGIN: u16 = 0x0002; |
| 172 | pub const DOWNLOAD_FLAG_END: u16 = 0x0004; | 175 | pub const DOWNLOAD_FLAG_END: u16 = 0x0004; |
