aya: rename MapError::NotFound to MapError::MapNotFound

pull/1/head
Alessandro Decina 4 years ago
parent 3a5b289163
commit fd142e467c

@ -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<MapRef, MapError> {
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<MapRefMut, MapError> {
self.maps
.get(name)
.ok_or_else(|| MapError::NotFound {
.ok_or_else(|| MapError::MapNotFound {
name: name.to_owned(),
})
.and_then(|lock| {

@ -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 },

Loading…
Cancel
Save