From 7541b6f3f3738547f2a11ae4f21beab25901580c Mon Sep 17 00:00:00 2001 From: Alex Orlenko Date: Tue, 4 May 2021 23:57:47 +0100 Subject: Remove deprecated `AnyUserData::has_metamethod()` --- src/userdata.rs | 25 ------------------------- 1 file changed, 25 deletions(-) (limited to 'src/userdata.rs') diff --git a/src/userdata.rs b/src/userdata.rs index b4d687d..1fe62ab 100644 --- a/src/userdata.rs +++ b/src/userdata.rs @@ -767,31 +767,6 @@ impl<'lua> AnyUserData<'lua> { self.get_raw_metatable().map(UserDataMetatable) } - /// Checks for a metamethod in this `AnyUserData`. - /// - /// This function is deprecated and will be removed in v0.7. - /// Please use [`get_metatable`] function instead. - /// - /// [`get_metatable`]: #method.get_metatable - #[deprecated( - since = "0.6.0", - note = "Please use the get_metatable function instead" - )] - pub fn has_metamethod(&self, method: MetaMethod) -> Result { - match self.get_raw_metatable() { - Ok(mt) => { - let name = self.0.lua.create_string(method.validate()?.name())?; - if let Value::Nil = mt.raw_get(name)? { - Ok(false) - } else { - Ok(true) - } - } - Err(Error::UserDataTypeMismatch) => Ok(false), - Err(e) => Err(e), - } - } - fn get_raw_metatable(&self) -> Result> { unsafe { let lua = self.0.lua; -- cgit v1.2.3