diff --git a/Cargo.toml b/Cargo.toml index dc2eec57..b718fe83 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,7 +36,7 @@ uuid = { version = "0.7", features = ["v4"] } chrono = "0.4" # Date and time library for Rust openssl = "0.10" siphasher = "0.3" -endian_trait = "0.6" +endian_trait = { version = "0.6", features = ["arrays"] } walkdir = "2" md5 = "0.6" base64 = "0.10" diff --git a/proxmox-protocol/Cargo.toml b/proxmox-protocol/Cargo.toml index 7f67554f..5f995479 100644 --- a/proxmox-protocol/Cargo.toml +++ b/proxmox-protocol/Cargo.toml @@ -12,7 +12,7 @@ crate-type = ['lib', 'cdylib'] [dependencies] chrono = "0.4" -endian_trait = "0.6" +endian_trait = { version = "0.6", features = ["arrays"] } errno = "0.2" failure = "0.1" libc = "0.2" diff --git a/proxmox-protocol/src/protocol.rs b/proxmox-protocol/src/protocol.rs index c1169f83..fd28d120 100644 --- a/proxmox-protocol/src/protocol.rs +++ b/proxmox-protocol/src/protocol.rs @@ -165,16 +165,13 @@ pub mod server { pub const PROTOCOL_VERSION: u32 = 1; - #[derive(Eq, PartialEq)] - #[repr(C, packed)] - pub struct HelloMagic([u8; 8]); - pub const HELLO_MAGIC: HelloMagic = HelloMagic(*b"PMXBCKUP"); + pub const HELLO_MAGIC: [u8; 8] = *b"PMXBCKUP"; pub const HELLO_VERSION: u32 = 1; // the current version #[derive(Endian)] #[repr(C, packed)] pub struct Hello { - pub magic: HelloMagic, + pub magic: [u8; 8], pub version: u32, } @@ -191,21 +188,6 @@ pub mod server { // Data follows here... } - impl Endian for HelloMagic { - fn to_be(self) -> Self { - self - } - fn to_le(self) -> Self { - self - } - fn from_be(self) -> Self { - self - } - fn from_le(self) -> Self { - self - } - } - #[derive(Endian)] #[repr(C, packed)] pub struct BackupCreated {