diff --git a/aya/src/bpf.rs b/aya/src/bpf.rs index e7737867..c0ae24cc 100644 --- a/aya/src/bpf.rs +++ b/aya/src/bpf.rs @@ -197,12 +197,12 @@ impl Bpf { /// /// # Errors /// - /// Returns [`MapError::NotFound`] if the map does not exist. If the map is already borrowed + /// Returns [`MapError::MapNotFound`] if the map does not exist. If the map is already borrowed /// mutably with [map_mut](Self::map_mut) then [`MapError::BorrowError`] is returned. pub fn map(&self, name: &str) -> Result { self.maps .get(name) - .ok_or_else(|| MapError::NotFound { + .ok_or_else(|| MapError::MapNotFound { name: name.to_owned(), }) .and_then(|lock| { @@ -222,12 +222,12 @@ impl Bpf { /// /// # Errors /// - /// Returns [`MapError::NotFound`] if the map does not exist. If the map is already borrowed + /// Returns [`MapError::MapNotFound`] if the map does not exist. If the map is already borrowed /// mutably with [map_mut](Self::map_mut) then [`MapError::BorrowError`] is returned. pub fn map_mut(&self, name: &str) -> Result { self.maps .get(name) - .ok_or_else(|| MapError::NotFound { + .ok_or_else(|| MapError::MapNotFound { name: name.to_owned(), }) .and_then(|lock| { diff --git a/aya/src/maps/mod.rs b/aya/src/maps/mod.rs index 77d86a1d..76495e73 100644 --- a/aya/src/maps/mod.rs +++ b/aya/src/maps/mod.rs @@ -53,7 +53,7 @@ pub use program_array::ProgramArray; #[derive(Error, Debug)] pub enum MapError { #[error("map `{name}` not found ")] - NotFound { name: String }, + MapNotFound { name: String }, #[error("invalid map type {map_type}")] InvalidMapType { map_type: u32 },