aboutsummaryrefslogtreecommitdiff
path: root/src/structs.rs
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2022-09-26 14:12:34 +0200
committerGitHub <[email protected]>2022-09-26 14:12:34 +0200
commit7bbd4671d34dc80b44cbee2152de7d0b61056c01 (patch)
tree2358d183ffb04132695f8f478b18df392d634e60 /src/structs.rs
parent79a9a4eb9898b4e56544f78729b6e8960c884960 (diff)
parent9962db4ecf227792d777ff0bc91d9e4d50d24f85 (diff)
Merge pull request #24 from danbev/suppress-warnings
Suppress compiler warnings
Diffstat (limited to 'src/structs.rs')
-rw-r--r--src/structs.rs3
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}
168impl_bytes!(DownloadHeader); 170impl_bytes!(DownloadHeader);
169 171
172#[allow(unused)]
170pub const DOWNLOAD_FLAG_NO_CRC: u16 = 0x0001; 173pub const DOWNLOAD_FLAG_NO_CRC: u16 = 0x0001;
171pub const DOWNLOAD_FLAG_BEGIN: u16 = 0x0002; 174pub const DOWNLOAD_FLAG_BEGIN: u16 = 0x0002;
172pub const DOWNLOAD_FLAG_END: u16 = 0x0004; 175pub const DOWNLOAD_FLAG_END: u16 = 0x0004;