From 874c8cac1e872a9b6d5b900603406a2e49d811af Mon Sep 17 00:00:00 2001 From: Sybrand Aarnoutse Date: Mon, 6 Jul 2026 19:59:36 +0200 Subject: [PATCH] Remove dependency on `memoffset` for `target_os = "windows"` `memoffset::offset_of!` was stabilised as `core::mem::offset_of!` in rust 1.77 --- Cargo.toml | 3 --- src/transport/windows/winapi.rs | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b85a9c15..72c43010 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,9 +35,6 @@ devd-rs = "0.3" [target.'cfg(target_os = "macos")'.dependencies] core-foundation = "0.10" -[target.'cfg(target_os = "windows")'.dependencies] -memoffset = "0.8" - [target.'cfg(target_os = "windows")'.dependencies.winapi] version = "^0.3" features = [ diff --git a/src/transport/windows/winapi.rs b/src/transport/windows/winapi.rs index a1bee37b..441d0200 100644 --- a/src/transport/windows/winapi.rs +++ b/src/transport/windows/winapi.rs @@ -203,7 +203,7 @@ impl DeviceInterfaceDetailData { unsafe { (*data).cbSize = cb_size as minwindef::UINT }; // Compute offset of `SP_DEVICE_INTERFACE_DETAIL_DATA_W.DevicePath`. - let offset = memoffset::offset_of!(setupapi::SP_DEVICE_INTERFACE_DETAIL_DATA_W, DevicePath); + let offset = mem::offset_of!(setupapi::SP_DEVICE_INTERFACE_DETAIL_DATA_W, DevicePath); Some(Self { data,