File tree Expand file tree Collapse file tree 3 files changed +5
-7
lines changed Expand file tree Collapse file tree 3 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ use std::{
99 error,
1010 fmt:: { self , Display } ,
1111 future:: Future ,
12- mem , ops,
12+ ops,
1313 pin:: Pin ,
1414 sync:: Arc ,
1515 task:: { Context , Poll } ,
@@ -109,7 +109,7 @@ pub fn get_error_hook() -> Option<Arc<dyn ErrorHook>> {
109109/// Sets the current thread-local error hook, which will be invoked when [`throw`] is called.
110110pub fn set_error_hook ( hook : Arc < dyn ErrorHook > ) -> ResetErrorHookOnDrop {
111111 ResetErrorHookOnDrop (
112- ERROR_HOOK . with_borrow_mut ( |this| mem :: replace ( this, Some ( hook) ) ) ,
112+ ERROR_HOOK . with_borrow_mut ( |this| Option :: replace ( this, hook) ) ,
113113 )
114114}
115115
Original file line number Diff line number Diff line change @@ -208,9 +208,7 @@ impl Owner {
208208 /// Runs the given function with this as the current `Owner`.
209209 pub fn with < T > ( & self , fun : impl FnOnce ( ) -> T ) -> T {
210210 let prev = {
211- OWNER . with ( |o| {
212- mem:: replace ( & mut * o. borrow_mut ( ) , Some ( self . clone ( ) ) )
213- } )
211+ OWNER . with ( |o| Option :: replace ( & mut * o. borrow_mut ( ) , self . clone ( ) ) )
214212 } ;
215213 #[ cfg( feature = "sandboxed-arenas" ) ]
216214 Arena :: set ( & self . inner . read ( ) . or_poisoned ( ) . arena ) ;
Original file line number Diff line number Diff line change @@ -37,9 +37,9 @@ impl AsyncTransition {
3737 let ( tx, rx) = mpsc:: channel ( ) ;
3838 let global_transition = global_transition ( ) ;
3939 let inner = TransitionInner { tx } ;
40- let prev = std :: mem :: replace (
40+ let prev = Option :: replace (
4141 & mut * global_transition. write ( ) . or_poisoned ( ) ,
42- Some ( inner. clone ( ) ) ,
42+ inner. clone ( ) ,
4343 ) ;
4444 let value = action ( ) . await ;
4545 _ = std:: mem:: replace (
You can’t perform that action at this time.
0 commit comments