Skip to content

Commit d50c8df

Browse files
committed
Use ref instead of ownership
1 parent bad0fa9 commit d50c8df

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/actor.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ impl Actor {
151151
#[inline]
152152
pub fn def_fn_with_name<'lua, 'callback, F, A, R>(
153153
lua: &'lua Lua,
154-
table: Table<'lua>,
154+
table: &Table<'lua>,
155155
func: F,
156156
key: &str,
157157
) -> Result<Function<'lua>, Error>
@@ -179,12 +179,12 @@ impl Actor {
179179
let lua = self.lua.clone();
180180
_handler.lock().unwrap().post(RawFunc::new(move || {
181181
let lua = lua.lock().unwrap();
182-
let _ = Self::def_fn_with_name(&lua, lua.globals(), func.clone(), key);
182+
let _ = Self::def_fn_with_name(&lua, &lua.globals(), func.clone(), key);
183183
}));
184184
}
185185
None => {
186186
let lua = self.lua.lock().unwrap();
187-
Self::def_fn_with_name(&lua, lua.globals(), func.clone(), key)?;
187+
Self::def_fn_with_name(&lua, &lua.globals(), func.clone(), key)?;
188188
}
189189
}
190190

0 commit comments

Comments
 (0)