[pbs-devel] [PATCH proxmox-backup v2 08/14] bin: clippy fixes

Dominik Csapak d.csapak at proxmox.com
Fri Apr 16 12:29:04 CEST 2021


fixes:
* `len() < 1` => `is_empty()`
* redundant closure
* unnecessary return

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 src/bin/docgen.rs | 2 +-
 src/bin/pmtx.rs   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/bin/docgen.rs b/src/bin/docgen.rs
index 9df9f33b..1f9657ea 100644
--- a/src/bin/docgen.rs
+++ b/src/bin/docgen.rs
@@ -46,7 +46,7 @@ fn main() -> Result<(), Error> {
 
     let (_prefix, args) = get_args();
 
-    if args.len() < 1 {
+    if args.is_empty() {
         bail!("missing arguments");
     }
 
diff --git a/src/bin/pmtx.rs b/src/bin/pmtx.rs
index 88074002..4a59d624 100644
--- a/src/bin/pmtx.rs
+++ b/src/bin/pmtx.rs
@@ -262,7 +262,7 @@ fn unload(
 
         if let Some(to_slot) = status.find_free_slot(false) {
             sg_pt_changer::unload(&mut file, to_slot, drivenum)?;
-            return Ok(());
+            Ok(())
         } else {
             bail!("Drive '{}' unload failure - no free slot", drivenum);
         }
-- 
2.20.1






More information about the pbs-devel mailing list