Skip to content

Commit a4c9192

Browse files
committed
Don't clone function name when calling async userdata method
1 parent e4d6e92 commit a4c9192

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/userdata_impl.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ impl<'lua, T: 'static> UserDataRegistry<'lua, T> {
218218
MR: Future<Output = Result<R>> + 's,
219219
R: IntoLuaMulti<'lua>,
220220
{
221-
let name = get_function_name::<T>(name);
221+
let name = Arc::new(get_function_name::<T>(name));
222222
let method = Arc::new(method);
223223

224224
Box::new(move |lua, mut args| unsafe {
@@ -312,7 +312,7 @@ impl<'lua, T: 'static> UserDataRegistry<'lua, T> {
312312
MR: Future<Output = Result<R>> + 's,
313313
R: IntoLuaMulti<'lua>,
314314
{
315-
let name = get_function_name::<T>(name);
315+
let name = Arc::new(get_function_name::<T>(name));
316316
let method = Arc::new(method);
317317

318318
Box::new(move |lua, mut args| unsafe {

0 commit comments

Comments
 (0)