aboutsummaryrefslogtreecommitdiff
path: root/src/structs.rs
diff options
context:
space:
mode:
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;