From a08b47bf3199cac8488a5f52862a6aa930437dd1 Mon Sep 17 00:00:00 2001 From: Serial <69764315+Serial-ATA@users.noreply.github.com> Date: Tue, 2 Aug 2022 21:48:50 -0400 Subject: [PATCH] Resolve: Remove `remove_custom_resolver` --- src/resolve.rs | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/src/resolve.rs b/src/resolve.rs index b80d630f..fe8a1eda 100644 --- a/src/resolve.rs +++ b/src/resolve.rs @@ -95,7 +95,7 @@ impl ObjectSafeFileResolver for GhostlyResolver { /// /// # Panics /// -/// * Attempting to register an existing name or type (See [`remove_custom_resolver`]) +/// * Attempting to register an existing name or type /// * See [`Mutex::lock`] pub fn register_custom_resolver(name: &'static str) { let mut res = CUSTOM_RESOLVERS.lock().unwrap(); @@ -111,23 +111,6 @@ pub fn register_custom_resolver(name: &'static str) { res.insert(name, Box::leak::<'static>(b)); } -/// Remove a registered file resolver -/// -/// # Panics -/// -/// See [`Mutex::lock`] -pub fn remove_custom_resolver(name: &'static str) { - let mut resolvers = CUSTOM_RESOLVERS.lock().unwrap(); - - if let Some(res) = resolvers.remove(name) { - unsafe { - #[allow(trivial_casts)] - let b = Box::from_raw(res as *const _ as *mut dyn ObjectSafeFileResolver); - drop(b); - } - } -} - #[cfg(test)] mod tests { use crate::id3::v2::ID3v2Tag;