From 7eee253d8c571055615eafd9fb72c17f7bc43008 Mon Sep 17 00:00:00 2001 From: Maximiliano Sandoval Date: Mon, 2 Dec 2024 10:58:02 +0100 Subject: [PATCH] remove needless type conversion The mount types were probably here for compatibility with older proxmox-sys. Fixes the useless_conversion clippy lints: ``` warning: useless conversion to the same type: `std::os::fd::OwnedFd` --> proxmox-backup-client/src/mount.rs:172:23 | 172 | let pr: OwnedFd = pr.into(); // until next sys bump | ^^^^^^^^^ help: consider removing `.into()`: `pr` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion = note: `#[warn(clippy::useless_conversion)]` on by default warning: useless conversion to the same type: `std::os::fd::OwnedFd` --> proxmox-backup-client/src/mount.rs:173:23 | 173 | let pw: OwnedFd = pw.into(); | ^^^^^^^^^ help: consider removing `.into()`: `pw` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion warning: useless conversion to the same type: `pbs_api_types::BackupArchiveName` --> proxmox-file-restore/src/main.rs:484:18 | 484 | &archive_name.try_into()?, | ^^^^^^^^^^^^^^^^^^^^^^^ | = help: consider removing `.try_into()` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion = note: `#[warn(clippy::useless_conversion)]` on by default ``` Signed-off-by: Maximiliano Sandoval --- proxmox-backup-client/src/mount.rs | 2 -- proxmox-file-restore/src/main.rs | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/proxmox-backup-client/src/mount.rs b/proxmox-backup-client/src/mount.rs index 0048a8ad..4929f5e5 100644 --- a/proxmox-backup-client/src/mount.rs +++ b/proxmox-backup-client/src/mount.rs @@ -169,8 +169,6 @@ fn mount( // Process should be daemonized. // Make sure to fork before the async runtime is instantiated to avoid troubles. let (pr, pw) = proxmox_sys::pipe()?; - let pr: OwnedFd = pr.into(); // until next sys bump - let pw: OwnedFd = pw.into(); match unsafe { fork() } { Ok(ForkResult::Parent { .. }) => { drop(pw); diff --git a/proxmox-file-restore/src/main.rs b/proxmox-file-restore/src/main.rs index bbfc6eb4..59ccbe52 100644 --- a/proxmox-file-restore/src/main.rs +++ b/proxmox-file-restore/src/main.rs @@ -479,7 +479,7 @@ async fn extract( let (archive_name, payload_archive_name) = pbs_client::tools::get_pxar_archive_names(&archive_name, &manifest)?; let (reader, archive_size) = get_remote_pxar_reader( - &archive_name.try_into()?, + &archive_name, client.clone(), &manifest, crypt_config.clone(),