From a83f781d5fd1b9ddc57fd687c4f37bf7bec9ce73 Mon Sep 17 00:00:00 2001 From: Juan Aguilar Santillana Date: Sat, 7 Dec 2024 14:25:52 +0100 Subject: [PATCH] fix: use core::mem::offset_of --- src/unix/linux_like/linux/mod.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs index ea24eb2b154e..bfab4d98bb8a 100644 --- a/src/unix/linux_like/linux/mod.rs +++ b/src/unix/linux_like/linux/mod.rs @@ -5301,10 +5301,7 @@ pub const CANXL_SEC: c_int = 0x01; pub const CAN_MTU: usize = size_of::(); pub const CANFD_MTU: usize = size_of::(); pub const CANXL_MTU: usize = size_of::(); -// FIXME(offset_of): use `core::mem::offset_of!` once that is available -// https://github.com/rust-lang/rfcs/pull/3308 -// pub const CANXL_HDR_SIZE: usize = core::mem::offset_of!(canxl_frame, data); -pub const CANXL_HDR_SIZE: usize = 12; +pub const CANXL_HDR_SIZE: usize = core::mem::offset_of!(canxl_frame, data); pub const CANXL_MIN_MTU: usize = CANXL_HDR_SIZE + 64; pub const CANXL_MAX_MTU: usize = CANXL_MTU;