[pdm-devel] [PATCH proxmox-api-types 4/4] generated code: Do not return unit value

Maximiliano Sandoval m.sandoval at proxmox.com
Mon Jan 13 13:12:24 CET 2025


Fixes:

warning: passing a unit value to a function
    --> lib/proxmox-api-types/pve-api-types/src/client/../generated/code.rs:1007:9
     |
1007 |         Ok(self.0.delete(&url).await?.expect_json()?.data)
     |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unit_arg
     = note: `#[warn(clippy::unit_arg)]` on by default
help: move the expression in front of the call and replace it with the unit literal `()`
     |
1007 ~         self.0.delete(&url).await?.expect_json()?.data;
1008 +         Ok(())
     |

Signed-off-by: Maximiliano Sandoval <m.sandoval at proxmox.com>
---
 pve-api-types/src/generated/code.rs | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pve-api-types/src/generated/code.rs b/pve-api-types/src/generated/code.rs
index 3da259b..211e297 100644
--- a/pve-api-types/src/generated/code.rs
+++ b/pve-api-types/src/generated/code.rs
@@ -1004,7 +1004,8 @@ where
     /// Stop a task.
     async fn stop_task(&self, node: &str, upid: &str) -> Result<(), Error> {
         let url = format!("/api2/extjs/nodes/{node}/tasks/{upid}");
-        Ok(self.0.delete(&url).await?.expect_json()?.data)
+        self.0.delete(&url).await?.expect_json::<()>()?;
+        Ok(())
     }
 
     /// API version details, including some parts of the global datacenter
-- 
2.39.5





More information about the pdm-devel mailing list