chore: update Rust to 1.95; replace cfg_if with cfg_select (#2121)

This commit is contained in:
Luna Yao
2026-04-17 17:41:31 +02:00
committed by GitHub
parent bcb2e512d4
commit fae32361f2
16 changed files with 66 additions and 94 deletions
+3 -5
View File
@@ -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
}