@@ -258,7 +258,7 @@ impl<'lua, 'scope> Scope<'lua, 'scope> {
258
258
if ffi:: lua_getmetatable ( lua. state , -1 ) == 0 {
259
259
return Err ( Error :: UserDataTypeMismatch ) ;
260
260
}
261
- ffi:: lua_pushstring ( lua. state , cstr ! ( "__mlua " ) ) ;
261
+ ffi:: lua_pushstring ( lua. state , cstr ! ( "__mlua_ptr " ) ) ;
262
262
if ffi:: lua_rawget ( lua. state , -2 ) == ffi:: LUA_TLIGHTUSERDATA {
263
263
let ud_ptr = ffi:: lua_touserdata ( lua. state , -1 ) ;
264
264
if ud_ptr == check_data. as_ptr ( ) as * mut c_void {
@@ -330,7 +330,7 @@ impl<'lua, 'scope> Scope<'lua, 'scope> {
330
330
ffi:: lua_newtable ( state) ;
331
331
332
332
// Add internal metamethod to store reference to the data
333
- ffi:: lua_pushstring ( state, cstr ! ( "__mlua " ) ) ;
333
+ ffi:: lua_pushstring ( state, cstr ! ( "__mlua_ptr " ) ) ;
334
334
ffi:: lua_pushlightuserdata ( lua. state , data. as_ptr ( ) as * mut c_void ) ;
335
335
ffi:: lua_rawset ( state, -3 ) ;
336
336
} ) ?;
@@ -353,7 +353,7 @@ impl<'lua, 'scope> Scope<'lua, 'scope> {
353
353
let metatable_index = ffi:: lua_absindex ( lua. state , -1 ) ;
354
354
355
355
let mut field_getters_index = None ;
356
- if ud_fields. field_getters . len ( ) > 0 {
356
+ if ! ud_fields. field_getters . is_empty ( ) {
357
357
protect_lua_closure ( lua. state , 0 , 1 , |state| {
358
358
ffi:: lua_newtable ( state) ;
359
359
} ) ?;
@@ -369,7 +369,7 @@ impl<'lua, 'scope> Scope<'lua, 'scope> {
369
369
}
370
370
371
371
let mut field_setters_index = None ;
372
- if ud_fields. field_setters . len ( ) > 0 {
372
+ if ! ud_fields. field_setters . is_empty ( ) {
373
373
protect_lua_closure ( lua. state , 0 , 1 , |state| {
374
374
ffi:: lua_newtable ( state) ;
375
375
} ) ?;
@@ -385,7 +385,7 @@ impl<'lua, 'scope> Scope<'lua, 'scope> {
385
385
}
386
386
387
387
let mut methods_index = None ;
388
- if ud_methods. methods . len ( ) > 0 {
388
+ if ! ud_methods. methods . is_empty ( ) {
389
389
// Create table used for methods lookup
390
390
protect_lua_closure ( lua. state , 0 , 1 , |state| {
391
391
ffi:: lua_newtable ( state) ;
@@ -738,6 +738,7 @@ impl<'lua, T: UserData> UserDataMethods<'lua, T> for NonStaticUserDataMethods<'l
738
738
struct NonStaticUserDataFields < ' lua , T : UserData > {
739
739
field_getters : Vec < ( Vec < u8 > , NonStaticMethod < ' lua , T > ) > ,
740
740
field_setters : Vec < ( Vec < u8 > , NonStaticMethod < ' lua , T > ) > ,
741
+ #[ allow( clippy:: type_complexity) ]
741
742
meta_fields : Vec < ( MetaMethod , Box < dyn Fn ( & ' lua Lua ) -> Result < Value < ' lua > > > ) > ,
742
743
}
743
744
0 commit comments