Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
0b01 committed Nov 15, 2022
1 parent 6ce60ad commit 76e417a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
8 changes: 5 additions & 3 deletions aya/src/maps/bloom_filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,11 @@ impl<T: AsRef<MapData>, V: Pod> BloomFilter<T, V> {
/// Inserts a value into the map.
pub fn insert(&self, value: impl Borrow<V>, 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(())
}
Expand Down
3 changes: 2 additions & 1 deletion aya/src/maps/hash_map/mod.rs
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
8 changes: 4 additions & 4 deletions aya/src/maps/hash_map/per_cpu_hash_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,12 @@ impl<T: AsMut<MapData>, K: Pod, V: Pod> PerCpuHashMap<T, K, V> {
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(())
}
Expand Down
8 changes: 5 additions & 3 deletions aya/src/maps/queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,11 @@ impl<T: AsMut<MapData>, V: Pod> Queue<T, V> {
/// [`MapError::SyscallError`] if `bpf_map_update_elem` fails.
pub fn push(&mut self, value: impl Borrow<V>, 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(())
}
Expand Down

0 comments on commit 76e417a

Please sign in to comment.