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 18
18
crate :: traits:: LuaNativeAsyncFn ,
19
19
crate :: types:: AsyncCallback ,
20
20
std:: future:: { self , Future } ,
21
- std:: pin:: Pin ,
21
+ std:: pin:: { pin , Pin } ,
22
22
std:: task:: { Context , Poll } ,
23
23
} ;
24
24
@@ -669,13 +669,9 @@ impl<R: FromLuaMulti> Future for AsyncCallFuture<R> {
669
669
type Output = Result < R > ;
670
670
671
671
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 ( ) ;
674
673
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) ,
679
675
Err ( err) => Poll :: Ready ( Err ( err. clone ( ) ) ) ,
680
676
}
681
677
}
You can’t perform that action at this time.
0 commit comments