From: Maximiliano Sandoval <m.sandoval@proxmox.com>
To: pdm-devel@lists.proxmox.com
Subject: [pdm-devel] [PATCH proxmox-api-types 4/4] generated code: Do not return unit value
Date: Mon, 13 Jan 2025 13:12:24 +0100 [thread overview]
Message-ID: <20250113121224.302766-4-m.sandoval@proxmox.com> (raw)
In-Reply-To: <20250113121224.302766-1-m.sandoval@proxmox.com>
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@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
_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel
next prev parent reply other threads:[~2025-01-13 12:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-13 12:12 [pdm-devel] [PATCH proxmox-api-types 1/4] verifiers: Remove manual contains() implementation Maximiliano Sandoval
2025-01-13 12:12 ` [pdm-devel] [PATCH proxmox-api-types 2/4] types: elide lifetimes when possible Maximiliano Sandoval
2025-01-13 12:12 ` [pdm-devel] [PATCH proxmox-api-types 3/4] pve-api-types: Use &str instead of format! Maximiliano Sandoval
2025-01-14 13:21 ` Wolfgang Bumiller
2025-01-13 12:12 ` Maximiliano Sandoval [this message]
2025-01-13 12:21 ` [pdm-devel] applied: [PATCH proxmox-api-types 1/4] verifiers: Remove manual contains() implementation Dietmar Maurer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250113121224.302766-4-m.sandoval@proxmox.com \
--to=m.sandoval@proxmox.com \
--cc=pdm-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.