From a3d968c59967ace95e3adbf5ebc38ae0a88f67ce Mon Sep 17 00:00:00 2001 From: Rafael Ortiz Date: Tue, 22 Jun 2021 08:00:26 -0400 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Alessandro Decina --- aya/src/bpf.rs | 4 ++-- aya/src/obj/mod.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/aya/src/bpf.rs b/aya/src/bpf.rs index 175798cd..32b2acf8 100644 --- a/aya/src/bpf.rs +++ b/aya/src/bpf.rs @@ -57,8 +57,8 @@ pub(crate) struct bpf_map_def { pub(crate) max_entries: u32, pub(crate) map_flags: u32, // optional features - pub(crate) id: u32, // id - pub(crate) pinning: u32, // pinning + pub(crate) id: u32, + pub(crate) pinning: u32, } /// The main entry point into the library, used to work with eBPF programs and maps. diff --git a/aya/src/obj/mod.rs b/aya/src/obj/mod.rs index 5e548a3a..88755e38 100644 --- a/aya/src/obj/mod.rs +++ b/aya/src/obj/mod.rs @@ -516,7 +516,7 @@ fn parse_map_def(name: &str, data: &[u8]) -> Result { } if data.len() < mem::size_of::() { - let mut map_def = bpf_map_def { ..Default::default() }; + let mut map_def = bpf_map_def::default(); unsafe { ptr::copy(data.as_ptr() as *const bpf_map_def, &mut map_def as *mut bpf_map_def, 1); // id and pinning will be garbage data