]> git.proxmox.com Git - proxmox.git/commitdiff
client: clippy: factor out complex type
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Fri, 28 Jun 2024 09:38:59 +0000 (11:38 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Fri, 28 Jun 2024 09:38:59 +0000 (11:38 +0200)
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
proxmox-client/src/client.rs

index fe18097ad42d5fb7de988f83fc33bc309db3c142..b840831da81fa6a41f90a95c24a032633a893083 100644 (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 {