From 03a15b98643a520269197e5db98cc48715a61577 Mon Sep 17 00:00:00 2001 From: Dave Tucker Date: Tue, 2 Aug 2022 11:35:52 +0000 Subject: [PATCH] aya: Remove MapError::InvalidPinPath Signed-off-by: Dave Tucker --- aya/src/maps/mod.rs | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/aya/src/maps/mod.rs b/aya/src/maps/mod.rs index a251a8b3..498b06e1 100644 --- a/aya/src/maps/mod.rs +++ b/aya/src/maps/mod.rs @@ -102,13 +102,6 @@ pub enum MapError { name: String, }, - /// Pin path is invalid - #[error("invalid map path `{error}`")] - InvalidPinPath { - /// The error message - error: String, - }, - /// The map has not been created #[error("the map has not been created")] NotCreated, @@ -300,14 +293,7 @@ impl Map { return Err(MapError::AlreadyCreated { name: name.into() }); } let map_path = path.as_ref().join(name); - let path_string = match CString::new(map_path.to_str().unwrap()) { - Ok(s) => s, - Err(e) => { - return Err(MapError::InvalidPinPath { - error: e.to_string(), - }) - } - }; + let path_string = CString::new(map_path.to_str().unwrap()).unwrap(); let fd = bpf_get_object(&path_string).map_err(|(code, io_error)| MapError::SyscallError { call: "BPF_OBJ_GET".to_string(),