From fac7cce224ca38e88e30ed0f16b0e93782625b0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BChlbacher?= Date: Mon, 3 Jun 2024 16:57:27 +0200 Subject: [PATCH] fix: unbreak subvolume commands MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This was a stupid mistake by me, "fixing" more than what clippy told me to. `p` is already a reference and we should not use the addr of it. Fixes: 96a3462 ("refactor: casting-related `clippy::pedantic` fixes") Signed-off-by: Thomas Mühlbacher --- src/wrappers/handle.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wrappers/handle.rs b/src/wrappers/handle.rs index b5b49628..b9a4a63d 100644 --- a/src/wrappers/handle.rs +++ b/src/wrappers/handle.rs @@ -1,4 +1,4 @@ -use std::{path::Path, ptr}; +use std::path::Path; use bch_bindgen::c::{ bcache_fs_close, bcache_fs_open, bch_ioctl_subvolume, bchfs_handle, BCH_IOCTL_SUBVOLUME_CREATE, @@ -42,7 +42,7 @@ pub enum BcachefsIoctlPayload { impl From<&BcachefsIoctlPayload> for *const libc::c_void { fn from(value: &BcachefsIoctlPayload) -> Self { match value { - BcachefsIoctlPayload::Subvolume(p) => ptr::addr_of!(p).cast(), + BcachefsIoctlPayload::Subvolume(p) => (p as *const bch_ioctl_subvolume).cast(), } } }