diff --git a/src/userdata_impl.rs b/src/userdata_impl.rs index f8e126e..6f4ba5d 100644 --- a/src/userdata_impl.rs +++ b/src/userdata_impl.rs @@ -365,7 +365,7 @@ impl<'lua, T: 'static> UserDataRegistrar<'lua, T> { // Returns function name for the type `T`, without the module path fn get_function_name(name: &str) -> StdString { - let type_name = any::type_name::().rsplitn(2, "::").next().unwrap(); + let type_name = any::type_name::().rsplit("::").next().unwrap(); format!("{type_name}.{name}",) }