Skip to content

Commit 3a2fd1e

Browse files
committed
Make AnyUserData::type_name public
1 parent a4c8b20 commit 3a2fd1e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/userdata.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -921,8 +921,10 @@ impl AnyUserData {
921921
lua.get_userdata_ref_type_id(&self.0).ok().flatten()
922922
}
923923

924-
/// Returns a type name of this `UserData` (from a metatable field).
925-
pub(crate) fn type_name(&self) -> Result<Option<StdString>> {
924+
/// Returns a type name of this userdata (from a metatable field).
925+
///
926+
/// If no type name is set, returns `None`.
927+
pub fn type_name(&self) -> Result<Option<StdString>> {
926928
let lua = self.0.lua.lock();
927929
let state = lua.state();
928930
unsafe {

0 commit comments

Comments
 (0)