client: clippy: factor out complex type

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2024-06-28 11:38:59 +02:00
parent 1f9cb87576
commit 635c8bcbed

View File

@ -22,6 +22,8 @@ use crate::{Error, Token};
use super::{HttpApiClient, HttpApiResponse};
/// See [`set_verify_callback`](openssl::ssl::SslContextBuilder::set_verify_callback()).
pub type TlsCallback = dyn Fn(bool, &mut x509::X509StoreContextRef) -> bool + Send + Sync + 'static;
#[derive(Default)]
pub enum TlsOptions {
/// Default TLS verification.
@ -38,7 +40,7 @@ pub enum TlsOptions {
CaCert(X509),
/// Use a callback for certificate verification.
Callback(Box<dyn Fn(bool, &mut x509::X509StoreContextRef) -> bool + Send + Sync + 'static>),
Callback(Box<TlsCallback>),
}
impl TlsOptions {