From: Maximiliano Sandoval <m.sandoval@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox 07/18] acl: remove null pointer cast
Date: Wed, 26 Jun 2024 12:45:03 +0200 [thread overview]
Message-ID: <20240626104514.384718-7-m.sandoval@proxmox.com> (raw)
In-Reply-To: <20240626104514.384718-1-m.sandoval@proxmox.com>
Fixes the clippy warning:
warning: casting raw pointers to the same type and constness is unnecessary (`*mut fs::acl::libc::c_void` -> `*mut fs::acl::libc::c_void`)
--> proxmox-sys/src/fs/acl.rs:130:23
|
130 | let mut ptr = ptr::null_mut() as *mut c_void;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `ptr::null_mut()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
= note: `#[warn(clippy::unnecessary_cast)]` on by default
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
---
proxmox-sys/src/fs/acl.rs | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/proxmox-sys/src/fs/acl.rs b/proxmox-sys/src/fs/acl.rs
index 5ac01bc3..6f256008 100644
--- a/proxmox-sys/src/fs/acl.rs
+++ b/proxmox-sys/src/fs/acl.rs
@@ -127,7 +127,7 @@ impl ACL {
}
pub fn create_entry(&mut self) -> Result<ACLEntry, nix::errno::Errno> {
- let mut ptr = ptr::null_mut() as *mut c_void;
+ let mut ptr = ptr::null_mut();
let res = unsafe { acl_create_entry(&mut self.ptr, &mut ptr) };
if res < 0 {
return Err(Errno::last());
@@ -200,7 +200,7 @@ impl<'a> ACLEntry<'a> {
pub fn get_permissions(&self) -> Result<u64, nix::errno::Errno> {
let mut permissions = 0;
- let mut permset = ptr::null_mut() as *mut c_void;
+ let mut permset = ptr::null_mut();
let mut res = unsafe { acl_get_permset(self.ptr, &mut permset) };
if res < 0 {
return Err(Errno::last());
@@ -221,7 +221,7 @@ impl<'a> ACLEntry<'a> {
}
pub fn set_permissions(&mut self, permissions: u64) -> Result<u64, nix::errno::Errno> {
- let mut permset = ptr::null_mut() as *mut c_void;
+ let mut permset = ptr::null_mut();
let mut res = unsafe { acl_get_permset(self.ptr, &mut permset) };
if res < 0 {
return Err(Errno::last());
--
2.39.2
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
next prev parent reply other threads:[~2024-06-26 10:45 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-26 10:44 [pbs-devel] [PATCH proxmox 01/18] use unwrap_or_default instead of unwrap_or(Vec::new) Maximiliano Sandoval
2024-06-26 10:44 ` [pbs-devel] [PATCH proxmox 02/18] use contains_key instead of .get().is_{some, none}() Maximiliano Sandoval
2024-06-26 11:16 ` Shannon Sterz
2024-06-26 12:07 ` Maximiliano Sandoval
2024-06-26 10:44 ` [pbs-devel] [PATCH proxmox 03/18] remove needless borrows Maximiliano Sandoval
2024-06-26 10:45 ` [pbs-devel] [PATCH proxmox 04/18] remove unnecesary pub(self) Maximiliano Sandoval
2024-06-26 10:45 ` [pbs-devel] [PATCH proxmox 05/18] time-api: remove redundant field names Maximiliano Sandoval
2024-06-26 10:45 ` [pbs-devel] [PATCH proxmox 06/18] acme: remove duplicated attribute Maximiliano Sandoval
2024-06-26 10:45 ` Maximiliano Sandoval [this message]
2024-06-26 10:45 ` [pbs-devel] [PATCH proxmox 08/18] use const blocks in thread_local! calls Maximiliano Sandoval
2024-06-26 10:45 ` [pbs-devel] [PATCH proxmox 09/18] remove unneeded returns Maximiliano Sandoval
2024-06-26 10:45 ` [pbs-devel] [PATCH proxmox 10/18] shared-memory: remove unneeded generic parameter Maximiliano Sandoval
2024-06-26 10:45 ` [pbs-devel] [PATCH proxmox 11/18] network-api: remove useless uses of format! Maximiliano Sandoval
2024-06-26 10:45 ` [pbs-devel] [PATCH proxmox 12/18] http: remove redundant redefinition of binding Maximiliano Sandoval
2024-06-26 10:45 ` [pbs-devel] [PATCH proxmox 13/18] http: remove unnecessary cast Maximiliano Sandoval
2024-06-26 10:45 ` [pbs-devel] [PATCH proxmox 14/18] acme: elide explicit lifetimes Maximiliano Sandoval
2024-06-26 10:45 ` [pbs-devel] [PATCH proxmox 15/18] acme: derive Default for Status Maximiliano Sandoval
2024-06-26 10:45 ` [pbs-devel] [PATCH proxmox 16/18] acl: directly return struct rather than a binding Maximiliano Sandoval
2024-06-26 10:45 ` [pbs-devel] [PATCH proxmox 17/18] acme-api: remove manual implementation of Option::map Maximiliano Sandoval
2024-06-26 11:36 ` Shannon Sterz
2024-06-26 10:45 ` [pbs-devel] [PATCH proxmox 18/18] auth-api: do not clone struct implementing Copy Maximiliano Sandoval
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=20240626104514.384718-7-m.sandoval@proxmox.com \
--to=m.sandoval@proxmox.com \
--cc=pbs-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox