mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-05-07 02:09:06 +00:00
suppress clippy warnings when no feature flags are enabled (#2028)
This commit is contained in:
@@ -2,7 +2,6 @@ use crate::{
|
|||||||
common::{config::EncryptionAlgorithm, log},
|
common::{config::EncryptionAlgorithm, log},
|
||||||
tunnel::packet_def::ZCPacket,
|
tunnel::packet_def::ZCPacket,
|
||||||
};
|
};
|
||||||
use cfg_if::cfg_if;
|
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
#[cfg(feature = "wireguard")]
|
#[cfg(feature = "wireguard")]
|
||||||
@@ -61,8 +60,11 @@ impl Encryptor for NullCipher {
|
|||||||
pub fn create_encryptor(
|
pub fn create_encryptor(
|
||||||
algorithm: &str,
|
algorithm: &str,
|
||||||
key_128: [u8; 16],
|
key_128: [u8; 16],
|
||||||
key_256: [u8; 32],
|
#[allow(unused_variables)] key_256: [u8; 32],
|
||||||
) -> Arc<dyn Encryptor> {
|
) -> Arc<dyn Encryptor> {
|
||||||
|
#[cfg(any(feature = "aes-gcm", feature = "wireguard", feature = "openssl-crypto"))]
|
||||||
|
use cfg_if::cfg_if;
|
||||||
|
|
||||||
let algorithm = match EncryptionAlgorithm::try_from(algorithm) {
|
let algorithm = match EncryptionAlgorithm::try_from(algorithm) {
|
||||||
Ok(algorithm) => algorithm,
|
Ok(algorithm) => algorithm,
|
||||||
Err(_) => {
|
Err(_) => {
|
||||||
@@ -75,6 +77,7 @@ pub fn create_encryptor(
|
|||||||
default
|
default
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
match algorithm {
|
match algorithm {
|
||||||
EncryptionAlgorithm::Xor => Arc::new(xor::XorCipher::new(&key_128)),
|
EncryptionAlgorithm::Xor => Arc::new(xor::XorCipher::new(&key_128)),
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user