feat: separate zstd and faketcp into features (#1861)

* feat: separate faketcp into a feature
* fix: no need to initialize out_len
* feat: separate zstd into a feature
* clippy: remove unnecessary cast, because for unix size_t always equals usize
This commit is contained in:
Chenx Dust
2026-02-03 11:12:33 +08:00
committed by GitHub
parent 7750e81168
commit e1cbd07d1f
8 changed files with 79 additions and 23 deletions
+2
View File
@@ -288,6 +288,7 @@ pub const AES_GCM_ENCRYPTION_RESERVED: usize = std::mem::size_of::<AesGcmTail>()
#[repr(u8)]
pub enum CompressorAlgo {
None = 0,
#[cfg(feature = "zstd")]
ZstdDefault = 1,
}
@@ -301,6 +302,7 @@ pub const COMPRESSOR_TAIL_SIZE: usize = std::mem::size_of::<CompressorTail>();
impl CompressorTail {
pub fn get_algo(&self) -> Option<CompressorAlgo> {
match self.algo {
#[cfg(feature = "zstd")]
1 => Some(CompressorAlgo::ZstdDefault),
_ => None,
}