From fd142e467c32b6aa4b0d2e8d62816a63c1fa4220 Mon Sep 17 00:00:00 2001 From: Alessandro Decina Date: Sat, 13 Mar 2021 22:00:04 +0000 Subject: [PATCH] aya: rename MapError::NotFound to MapError::MapNotFound --- aya/src/bpf.rs | 8 ++++---- aya/src/maps/mod.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) 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 },