@@ -258,7 +258,7 @@ impl<'lua, 'scope> Scope<'lua, 'scope> {
258258 if ffi:: lua_getmetatable ( lua. state , -1 ) == 0 {
259259 return Err ( Error :: UserDataTypeMismatch ) ;
260260 }
261- ffi:: lua_pushstring ( lua. state , cstr ! ( "__mlua " ) ) ;
261+ ffi:: lua_pushstring ( lua. state , cstr ! ( "__mlua_ptr " ) ) ;
262262 if ffi:: lua_rawget ( lua. state , -2 ) == ffi:: LUA_TLIGHTUSERDATA {
263263 let ud_ptr = ffi:: lua_touserdata ( lua. state , -1 ) ;
264264 if ud_ptr == check_data. as_ptr ( ) as * mut c_void {
@@ -330,7 +330,7 @@ impl<'lua, 'scope> Scope<'lua, 'scope> {
330330 ffi:: lua_newtable ( state) ;
331331
332332 // Add internal metamethod to store reference to the data
333- ffi:: lua_pushstring ( state, cstr ! ( "__mlua " ) ) ;
333+ ffi:: lua_pushstring ( state, cstr ! ( "__mlua_ptr " ) ) ;
334334 ffi:: lua_pushlightuserdata ( lua. state , data. as_ptr ( ) as * mut c_void ) ;
335335 ffi:: lua_rawset ( state, -3 ) ;
336336 } ) ?;
@@ -353,7 +353,7 @@ impl<'lua, 'scope> Scope<'lua, 'scope> {
353353 let metatable_index = ffi:: lua_absindex ( lua. state , -1 ) ;
354354
355355 let mut field_getters_index = None ;
356- if ud_fields. field_getters . len ( ) > 0 {
356+ if ! ud_fields. field_getters . is_empty ( ) {
357357 protect_lua_closure ( lua. state , 0 , 1 , |state| {
358358 ffi:: lua_newtable ( state) ;
359359 } ) ?;
@@ -369,7 +369,7 @@ impl<'lua, 'scope> Scope<'lua, 'scope> {
369369 }
370370
371371 let mut field_setters_index = None ;
372- if ud_fields. field_setters . len ( ) > 0 {
372+ if ! ud_fields. field_setters . is_empty ( ) {
373373 protect_lua_closure ( lua. state , 0 , 1 , |state| {
374374 ffi:: lua_newtable ( state) ;
375375 } ) ?;
@@ -385,7 +385,7 @@ impl<'lua, 'scope> Scope<'lua, 'scope> {
385385 }
386386
387387 let mut methods_index = None ;
388- if ud_methods. methods . len ( ) > 0 {
388+ if ! ud_methods. methods . is_empty ( ) {
389389 // Create table used for methods lookup
390390 protect_lua_closure ( lua. state , 0 , 1 , |state| {
391391 ffi:: lua_newtable ( state) ;
@@ -738,6 +738,7 @@ impl<'lua, T: UserData> UserDataMethods<'lua, T> for NonStaticUserDataMethods<'l
738738struct NonStaticUserDataFields < ' lua , T : UserData > {
739739 field_getters : Vec < ( Vec < u8 > , NonStaticMethod < ' lua , T > ) > ,
740740 field_setters : Vec < ( Vec < u8 > , NonStaticMethod < ' lua , T > ) > ,
741+ #[ allow( clippy:: type_complexity) ]
741742 meta_fields : Vec < ( MetaMethod , Box < dyn Fn ( & ' lua Lua ) -> Result < Value < ' lua > > > ) > ,
742743}
743744
0 commit comments