File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change 1818 crate :: traits:: LuaNativeAsyncFn ,
1919 crate :: types:: AsyncCallback ,
2020 std:: future:: { self , Future } ,
21- std:: pin:: Pin ,
21+ std:: pin:: { pin , Pin } ,
2222 std:: task:: { Context , Poll } ,
2323} ;
2424
@@ -669,13 +669,9 @@ impl<R: FromLuaMulti> Future for AsyncCallFuture<R> {
669669 type Output = Result < R > ;
670670
671671 fn poll ( self : Pin < & mut Self > , cx : & mut Context < ' _ > ) -> Poll < Self :: Output > {
672- // Safety: We're not moving any pinned data
673- let this = unsafe { self . get_unchecked_mut ( ) } ;
672+ let this = self . get_mut ( ) ;
674673 match & mut this. 0 {
675- Ok ( thread) => {
676- let pinned_thread = unsafe { Pin :: new_unchecked ( thread) } ;
677- pinned_thread. poll ( cx)
678- }
674+ Ok ( thread) => pin ! ( thread) . poll ( cx) ,
679675 Err ( err) => Poll :: Ready ( Err ( err. clone ( ) ) ) ,
680676 }
681677 }
You can’t perform that action at this time.
0 commit comments