From 08211f6132fd93493267e853139f5f5724e093b0 Mon Sep 17 00:00:00 2001 From: Tuetuopay Date: Wed, 9 Feb 2022 00:16:14 +0100 Subject: [PATCH] aya: implement Pod for arrays of Pod types If a type is POD (meaning it can be converted to a byte array), then an array of such type is POD. Signed-off-by: Tuetuopay --- aya/src/bpf.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aya/src/bpf.rs b/aya/src/bpf.rs index afedf3ed..318fc03e 100644 --- a/aya/src/bpf.rs +++ b/aya/src/bpf.rs @@ -54,6 +54,9 @@ macro_rules! unsafe_impl_pod { unsafe_impl_pod!(i8, u8, i16, u16, i32, u32, i64, u64, u128, i128); +// It only makes sense that an array of POD types is itself POD +unsafe impl Pod for [T; N] {} + #[allow(non_camel_case_types)] #[repr(C)] #[derive(Copy, Clone, Debug, Default, PartialEq)]