[pbs-devel] [PATCH backup 5/8] fix the type_complexity clippy lint

Maximiliano Sandoval m.sandoval at proxmox.com
Thu Mar 6 14:12:32 CET 2025


Signed-off-by: Maximiliano Sandoval <m.sandoval at proxmox.com>
---
 proxmox-backup-client/src/main.rs                      |  4 +++-
 .../src/proxmox_restore_daemon/auth.rs                 | 10 ++++------
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/proxmox-backup-client/src/main.rs b/proxmox-backup-client/src/main.rs
index 0a2fc267..26a07b1c 100644
--- a/proxmox-backup-client/src/main.rs
+++ b/proxmox-backup-client/src/main.rs
@@ -193,13 +193,15 @@ pub async fn dir_or_last_from_group(
     }
 }
 
+type Catalog = CatalogWriter<TokioWriterAdapter<StdChannelWriter<Error>>>;
+
 async fn backup_directory<P: AsRef<Path>>(
     client: &BackupWriter,
     dir_path: P,
     archive_name: &BackupArchiveName,
     payload_target: Option<&BackupArchiveName>,
     chunk_size: Option<usize>,
-    catalog: Option<Arc<Mutex<CatalogWriter<TokioWriterAdapter<StdChannelWriter<Error>>>>>>,
+    catalog: Option<Arc<Mutex<Catalog>>>,
     pxar_create_options: pbs_client::pxar::PxarCreateOptions,
     upload_options: UploadOptions,
 ) -> Result<(BackupStats, Option<BackupStats>), Error> {
diff --git a/proxmox-restore-daemon/src/proxmox_restore_daemon/auth.rs b/proxmox-restore-daemon/src/proxmox_restore_daemon/auth.rs
index 8cfc4f13..8173d48a 100644
--- a/proxmox-restore-daemon/src/proxmox_restore_daemon/auth.rs
+++ b/proxmox-restore-daemon/src/proxmox_restore_daemon/auth.rs
@@ -39,17 +39,15 @@ pub fn read_ticket() -> Result<Arc<str>, Error> {
     Ok(ticket.into())
 }
 
-pub fn check_auth<'a>(
-    ticket: Arc<str>,
-    headers: &'a HeaderMap,
-    _method: &'a Method,
-) -> Pin<
+type AuthFn<'a> = Pin<
     Box<
         dyn Future<Output = Result<(String, Box<dyn UserInformation + Sync + Send>), AuthError>>
             + Send
             + 'a,
     >,
-> {
+>;
+
+pub fn check_auth<'a>(ticket: Arc<str>, headers: &'a HeaderMap, _method: &'a Method) -> AuthFn<'a> {
     Box::pin(async move {
         match headers.get(hyper::header::AUTHORIZATION) {
             Some(header) if header.to_str().unwrap_or("") == &*ticket => {
-- 
2.39.5





More information about the pbs-devel mailing list