summaryrefslogtreecommitdiff
path: root/src/userdata.rs
diff options
context:
space:
mode:
authorAlex Orlenko <zxteam@protonmail.com>2021-03-13 20:01:25 +0000
committerAlex Orlenko <zxteam@protonmail.com>2021-04-27 00:29:37 +0100
commit5a7ad9f7cd793db4a1f52e764c55de7c9b58ab22 (patch)
tree3f1c055d611093755b9247ef4a75cc3eb723c84c /src/userdata.rs
parentdecb5b9e37549288ce09b28f3534b96eabb23116 (diff)
downloadmlua-5a7ad9f7cd793db4a1f52e764c55de7c9b58ab22.zip
Fix some clippy warnings & minor changes
Diffstat (limited to 'src/userdata.rs')
-rw-r--r--src/userdata.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/userdata.rs b/src/userdata.rs
index ef8cbf4..12b4518 100644
--- a/src/userdata.rs
+++ b/src/userdata.rs
@@ -187,7 +187,9 @@ impl MetaMethod {
MetaMethod::Custom(name) if name == "__metatable" => {
Err(Error::MetaMethodRestricted(name))
}
- MetaMethod::Custom(name) if name == "__mlua" => Err(Error::MetaMethodRestricted(name)),
+ MetaMethod::Custom(name) if name.starts_with("__mlua") => {
+ Err(Error::MetaMethodRestricted(name))
+ }
_ => Ok(self),
}
}
@@ -714,7 +716,9 @@ impl<'lua> AnyUserData<'lua> {
/// Returns a metatable of this `UserData`.
///
/// Returned [`UserDataMetatable`] object wraps the original metatable and
- /// allows to provide safe access to it methods.
+ /// provides safe access to it methods.
+ ///
+ /// For `T: UserData + 'static` returned metatable is shared among all instances of type `T`.
///
/// [`UserDataMetatable`]: struct.UserDataMetatable.html
pub fn get_metatable(&self) -> Result<UserDataMetatable<'lua>> {