Clean up interrupt listener

This commit is contained in:
Filip Tibell 2023-08-21 09:57:55 -05:00
parent 888f00dd8b
commit 30dc027e3e

View file

@ -66,13 +66,11 @@ impl<'lua, 'fut> Scheduler<'lua, 'fut> {
let state = this.state.clone(); let state = this.state.clone();
lua.set_interrupt(move |_| { lua.set_interrupt(move |_| {
if let Some(id) = state.get_current_thread_id() { if let Some(id) = state.get_current_thread_id() {
match state.get_thread_error(id) { if let Some(err) = state.get_thread_error(id) {
Some(e) => Err(e), return Err(err);
None => Ok(LuaVmState::Continue),
} }
} else {
Ok(LuaVmState::Continue)
} }
Ok(LuaVmState::Continue)
}); });
this this