mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-05-07 10:14:35 +00:00
chore: update Rust to 1.95; replace cfg_if with cfg_select (#2121)
This commit is contained in:
@@ -7,7 +7,6 @@ use std::{
|
||||
|
||||
use anyhow::Context;
|
||||
use base64::{Engine as _, prelude::BASE64_STANDARD};
|
||||
use cfg_if::cfg_if;
|
||||
use clap::ValueEnum;
|
||||
use clap::builder::PossibleValue;
|
||||
use serde::{Deserialize, Serialize};
|
||||
@@ -109,10 +108,9 @@ impl ValueEnum for EncryptionAlgorithm {
|
||||
#[allow(clippy::derivable_impls)]
|
||||
impl Default for EncryptionAlgorithm {
|
||||
fn default() -> Self {
|
||||
cfg_if! {
|
||||
if #[cfg(any(feature = "aes-gcm", feature = "wireguard", feature = "openssl-crypto"))] {
|
||||
EncryptionAlgorithm::AesGcm
|
||||
} else {
|
||||
cfg_select! {
|
||||
any(feature = "aes-gcm", feature = "wireguard", feature = "openssl-crypto") => EncryptionAlgorithm::AesGcm,
|
||||
_ => {
|
||||
crate::common::log::warn!("no AEAD encryption algorithm is available, using INSECURE XOR");
|
||||
EncryptionAlgorithm::Xor
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user