mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-05-13 17:35:37 +00:00
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:
@@ -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,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user