diff --git a/vnt/src/compression/mod.rs b/vnt/src/compression/mod.rs index 797ed42..d9f06a8 100644 --- a/vnt/src/compression/mod.rs +++ b/vnt/src/compression/mod.rs @@ -135,6 +135,7 @@ impl Compressor { } #[test] +#[cfg(feature = "zstd_compress")] fn test_lz4() { use crate::protocol::extension::{CompressionAlgorithm, ExtensionTailPacket}; let lz4 = Compressor::Lz4; @@ -166,7 +167,7 @@ fn test_lz4() { unimplemented!() } }, - ExtensionTailPacket::Unknown => { + _ => { unimplemented!() } } @@ -174,6 +175,7 @@ fn test_lz4() { assert_eq!(in_packet.payload(), src_out_packet.payload()) } #[test] +#[cfg(feature = "zstd_compress")] fn test_zstd() { use crate::protocol::extension::{CompressionAlgorithm, ExtensionTailPacket}; let zstd = Compressor::Zstd(22); @@ -209,7 +211,7 @@ fn test_zstd() { unimplemented!() } }, - ExtensionTailPacket::Unknown => { + _ => { unimplemented!() } } diff --git a/vnt/src/protocol/mod.rs b/vnt/src/protocol/mod.rs index 0a96cc3..ee59859 100644 --- a/vnt/src/protocol/mod.rs +++ b/vnt/src/protocol/mod.rs @@ -137,6 +137,7 @@ impl> NetPacket { } Ok(NetPacket { data_len, buffer }) } + #[inline] pub fn buffer(&self) -> &[u8] { &self.buffer.as_ref()[..self.data_len] }