File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -815,11 +815,7 @@ impl OwnedAnyUserData {
815815impl < ' lua > AnyUserData < ' lua > {
816816 /// Checks whether the type of this userdata is `T`.
817817 pub fn is < T : ' static > ( & self ) -> bool {
818- match self . inspect ( |_: & UserDataCell < T > | Ok ( ( ) ) ) {
819- Ok ( ( ) ) => true ,
820- Err ( Error :: UserDataTypeMismatch ) => false ,
821- Err ( _) => unreachable ! ( ) ,
822- }
818+ self . inspect ( |_: & UserDataCell < T > | Ok ( ( ) ) ) . is_ok ( )
823819 }
824820
825821 /// Borrow this userdata immutably if it is of type `T`.
Original file line number Diff line number Diff line change @@ -370,6 +370,8 @@ fn test_userdata_take() -> Result<()> {
370370 r => panic ! ( "improper return for destructed userdata: {:?}" , r) ,
371371 }
372372
373+ assert ! ( !userdata. is:: <MyUserdata >( ) ) ;
374+
373375 drop ( userdata) ;
374376 lua. globals ( ) . raw_remove ( "userdata" ) ?;
375377 lua. gc_collect ( ) ?;
You can’t perform that action at this time.
0 commit comments