diff --git a/aya/src/maps/bloom_filter.rs b/aya/src/maps/bloom_filter.rs index 3e301d4de..615e64c71 100644 --- a/aya/src/maps/bloom_filter.rs +++ b/aya/src/maps/bloom_filter.rs @@ -64,9 +64,11 @@ impl, V: Pod> BloomFilter { /// Inserts a value into the map. pub fn insert(&self, value: impl Borrow, flags: u64) -> Result<(), MapError> { let fd = self.inner.as_ref().fd_or_err()?; - bpf_map_push_elem(fd, value.borrow(), flags).map_err(|(_, io_error)| MapError::SyscallError { - call: "bpf_map_push_elem".to_owned(), - io_error, + bpf_map_push_elem(fd, value.borrow(), flags).map_err(|(_, io_error)| { + MapError::SyscallError { + call: "bpf_map_push_elem".to_owned(), + io_error, + } })?; Ok(()) } diff --git a/aya/src/maps/hash_map/mod.rs b/aya/src/maps/hash_map/mod.rs index 63c4c174d..f1e1837f5 100644 --- a/aya/src/maps/hash_map/mod.rs +++ b/aya/src/maps/hash_map/mod.rs @@ -1,7 +1,8 @@ //! Hash map types. use crate::{ maps::MapError, - sys::{bpf_map_delete_elem, bpf_map_update_elem}, Pod, + sys::{bpf_map_delete_elem, bpf_map_update_elem}, + Pod, }; #[allow(clippy::module_inception)] diff --git a/aya/src/maps/hash_map/per_cpu_hash_map.rs b/aya/src/maps/hash_map/per_cpu_hash_map.rs index ea083634c..eb7fe6aea 100644 --- a/aya/src/maps/hash_map/per_cpu_hash_map.rs +++ b/aya/src/maps/hash_map/per_cpu_hash_map.rs @@ -123,12 +123,12 @@ impl, K: Pod, V: Pod> PerCpuHashMap { flags: u64, ) -> Result<(), MapError> { let fd = self.inner.as_mut().fd_or_err()?; - bpf_map_update_elem_per_cpu(fd, key.borrow(), &values, flags).map_err(|(_, io_error)| { - MapError::SyscallError { + bpf_map_update_elem_per_cpu(fd, key.borrow(), &values, flags).map_err( + |(_, io_error)| MapError::SyscallError { call: "bpf_map_update_elem".to_owned(), io_error, - } - })?; + }, + )?; Ok(()) } diff --git a/aya/src/maps/queue.rs b/aya/src/maps/queue.rs index 158c811d9..d10ecd04f 100644 --- a/aya/src/maps/queue.rs +++ b/aya/src/maps/queue.rs @@ -81,9 +81,11 @@ impl, V: Pod> Queue { /// [`MapError::SyscallError`] if `bpf_map_update_elem` fails. pub fn push(&mut self, value: impl Borrow, flags: u64) -> Result<(), MapError> { let fd = self.inner.as_mut().fd_or_err()?; - bpf_map_push_elem(fd, value.borrow(), flags).map_err(|(_, io_error)| MapError::SyscallError { - call: "bpf_map_push_elem".to_owned(), - io_error, + bpf_map_push_elem(fd, value.borrow(), flags).map_err(|(_, io_error)| { + MapError::SyscallError { + call: "bpf_map_push_elem".to_owned(), + io_error, + } })?; Ok(()) }