From 9525b1a370a0f3123bf97b31040ca6d07d315ef3 Mon Sep 17 00:00:00 2001 From: Ricky Han Date: Wed, 2 Nov 2022 07:00:07 +0000 Subject: [PATCH] fix array --- aya/src/maps/array/array.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aya/src/maps/array/array.rs b/aya/src/maps/array/array.rs index 72b48668..9344f192 100644 --- a/aya/src/maps/array/array.rs +++ b/aya/src/maps/array/array.rs @@ -89,11 +89,11 @@ impl, V: Pod> Array { /// /// Returns [`MapError::OutOfBounds`] if `index` is out of bounds, [`MapError::SyscallError`] /// if `bpf_map_update_elem` fails. - pub fn set(&mut self, index: u32, value: impl Borrow + Pod, flags: u64) -> Result<(), MapError> { + pub fn set(&mut self, index: u32, value: impl Borrow, flags: u64) -> Result<(), MapError> { let data = self.inner.as_mut(); check_bounds(data, index)?; let fd = data.fd_or_err()?; - bpf_map_update_elem(fd, Some(&index), &value, flags).map_err(|(_, io_error)| { + bpf_map_update_elem(fd, Some(&index), value.borrow(), flags).map_err(|(_, io_error)| { MapError::SyscallError { call: "bpf_map_update_elem".to_owned(), io_error,