@@ -1217,28 +1217,42 @@ impl RawLua {
1217
1217
{
1218
1218
unsafe extern "C-unwind" fn call_callback ( state : * mut ffi:: lua_State ) -> c_int {
1219
1219
let upvalue = get_userdata :: < ContinuationUpvalue > ( state, ffi:: lua_upvalueindex ( 1 ) ) ;
1220
- callback_error_ext_yieldable ( state, ( * upvalue) . extra . get ( ) , true , |extra, nargs| {
1221
- // Lua ensures that `LUA_MINSTACK` stack spaces are available (after pushing arguments)
1222
- // The lock must be already held as the callback is executed
1223
- let rawlua = ( * extra) . raw_lua ( ) ;
1224
- match ( * upvalue) . data {
1225
- Some ( ref func) => ( func. 0 ) ( rawlua, nargs) ,
1226
- None => Err ( Error :: CallbackDestructed ) ,
1227
- }
1228
- } )
1220
+ callback_error_ext_yieldable (
1221
+ state,
1222
+ ( * upvalue) . extra . get ( ) ,
1223
+ true ,
1224
+ |extra, nargs| {
1225
+ // Lua ensures that `LUA_MINSTACK` stack spaces are available (after pushing
1226
+ // arguments) The lock must be already held as the callback is
1227
+ // executed
1228
+ let rawlua = ( * extra) . raw_lua ( ) ;
1229
+ match ( * upvalue) . data {
1230
+ Some ( ref func) => ( func. 0 ) ( rawlua, nargs) ,
1231
+ None => Err ( Error :: CallbackDestructed ) ,
1232
+ }
1233
+ } ,
1234
+ true ,
1235
+ )
1229
1236
}
1230
1237
1231
1238
unsafe extern "C-unwind" fn cont_callback ( state : * mut ffi:: lua_State , status : c_int ) -> c_int {
1232
1239
let upvalue = get_userdata :: < ContinuationUpvalue > ( state, ffi:: lua_upvalueindex ( 1 ) ) ;
1233
- callback_error_ext_yieldable ( state, ( * upvalue) . extra . get ( ) , true , |extra, nargs| {
1234
- // Lua ensures that `LUA_MINSTACK` stack spaces are available (after pushing arguments)
1235
- // The lock must be already held as the callback is executed
1236
- let rawlua = ( * extra) . raw_lua ( ) ;
1237
- match ( * upvalue) . data {
1238
- Some ( ref func) => ( func. 1 ) ( rawlua, nargs, status) ,
1239
- None => Err ( Error :: CallbackDestructed ) ,
1240
- }
1241
- } )
1240
+ callback_error_ext_yieldable (
1241
+ state,
1242
+ ( * upvalue) . extra . get ( ) ,
1243
+ true ,
1244
+ |extra, nargs| {
1245
+ // Lua ensures that `LUA_MINSTACK` stack spaces are available (after pushing
1246
+ // arguments) The lock must be already held as the callback is
1247
+ // executed
1248
+ let rawlua = ( * extra) . raw_lua ( ) ;
1249
+ match ( * upvalue) . data {
1250
+ Some ( ref func) => ( func. 1 ) ( rawlua, nargs, status) ,
1251
+ None => Err ( Error :: CallbackDestructed ) ,
1252
+ }
1253
+ } ,
1254
+ true ,
1255
+ )
1242
1256
}
1243
1257
1244
1258
let state = self . state ( ) ;
0 commit comments