File tree Expand file tree Collapse file tree 3 files changed +5
-11
lines changed Expand file tree Collapse file tree 3 files changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -8,8 +8,7 @@ use std::{
88 cell:: RefCell ,
99 error,
1010 fmt:: { self , Display } ,
11- future:: Future ,
12- mem, ops,
11+ future:: Future , ops,
1312 pin:: Pin ,
1413 sync:: Arc ,
1514 task:: { Context , Poll } ,
@@ -108,9 +107,7 @@ pub fn get_error_hook() -> Option<Arc<dyn ErrorHook>> {
108107
109108/// Sets the current thread-local error hook, which will be invoked when [`throw`] is called.
110109pub fn set_error_hook ( hook : Arc < dyn ErrorHook > ) -> ResetErrorHookOnDrop {
111- ResetErrorHookOnDrop (
112- ERROR_HOOK . with_borrow_mut ( |this| this. replace ( hook) ) ,
113- )
110+ ResetErrorHookOnDrop ( ERROR_HOOK . with_borrow_mut ( |this| this. replace ( hook) ) )
114111}
115112
116113/// Invokes the error hook set by [`set_error_hook`] with the given error.
Original file line number Diff line number Diff line change @@ -207,11 +207,7 @@ impl Owner {
207207
208208 /// Runs the given function with this as the current `Owner`.
209209 pub fn with < T > ( & self , fun : impl FnOnce ( ) -> T ) -> T {
210- let prev = {
211- OWNER . with ( |o| {
212- ( * o. borrow_mut ( ) ) . replace ( self . clone ( ) )
213- } )
214- } ;
210+ let prev = { OWNER . with ( |o| ( * o. borrow_mut ( ) ) . replace ( self . clone ( ) ) ) } ;
215211 #[ cfg( feature = "sandboxed-arenas" ) ]
216212 Arena :: set ( & self . inner . read ( ) . or_poisoned ( ) . arena ) ;
217213 let val = fun ( ) ;
Original file line number Diff line number Diff line change @@ -37,7 +37,8 @@ impl AsyncTransition {
3737 let ( tx, rx) = mpsc:: channel ( ) ;
3838 let global_transition = global_transition ( ) ;
3939 let inner = TransitionInner { tx } ;
40- let prev = ( * global_transition. write ( ) . or_poisoned ( ) ) . replace ( inner. clone ( ) ) ;
40+ let prev =
41+ ( * global_transition. write ( ) . or_poisoned ( ) ) . replace ( inner. clone ( ) ) ;
4142 let value = action ( ) . await ;
4243 _ = std:: mem:: replace (
4344 & mut * global_transition. write ( ) . or_poisoned ( ) ,
You can’t perform that action at this time.
0 commit comments