summaryrefslogtreecommitdiff
path: root/src/userdata.rs
diff options
context:
space:
mode:
authorAlex Orlenko <zxteam@protonmail.com>2021-05-04 23:57:47 +0100
committerAlex Orlenko <zxteam@protonmail.com>2021-05-04 23:57:47 +0100
commit7541b6f3f3738547f2a11ae4f21beab25901580c (patch)
treea87797476aa8fcc9432d40d94a85dbbdcba678df /src/userdata.rs
parent205510a540ae9292a223024e3d9d75a2ae13022f (diff)
downloadmlua-7541b6f3f3738547f2a11ae4f21beab25901580c.zip
Remove deprecated `AnyUserData::has_metamethod()`
Diffstat (limited to 'src/userdata.rs')
-rw-r--r--src/userdata.rs25
1 files changed, 0 insertions, 25 deletions
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<bool> {
- 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<Table<'lua>> {
unsafe {
let lua = self.0.lua;