File tree Expand file tree Collapse file tree 3 files changed +3
-15
lines changed Expand file tree Collapse file tree 3 files changed +3
-15
lines changed Original file line number Diff line number Diff line change @@ -91,11 +91,7 @@ impl ContextExt for AsyncStdRuntime {
9191
9292 fn get_task_locals ( ) -> Option < TaskLocals > {
9393 TASK_LOCALS
94- . try_with ( |c| {
95- c. borrow ( )
96- . as_ref ( )
97- . map ( |locals| locals. clone ( ) )
98- } )
94+ . try_with ( |c| c. borrow ( ) . as_ref ( ) . map ( |locals| locals. clone ( ) ) )
9995 . unwrap_or_default ( )
10096 }
10197}
Original file line number Diff line number Diff line change @@ -1506,12 +1506,7 @@ struct SenderGlue {
15061506#[ pymethods]
15071507impl SenderGlue {
15081508 pub fn send ( & mut self , item : Py < PyAny > ) -> PyResult < Py < PyAny > > {
1509- Python :: attach ( |py| {
1510- self . tx
1511- . lock ( )
1512- . unwrap ( )
1513- . send ( py, self . locals . clone ( ) , item)
1514- } )
1509+ Python :: attach ( |py| self . tx . lock ( ) . unwrap ( ) . send ( py, self . locals . clone ( ) , item) )
15151510 }
15161511 pub fn close ( & mut self ) -> PyResult < ( ) > {
15171512 self . tx . lock ( ) . unwrap ( ) . close ( )
Original file line number Diff line number Diff line change @@ -109,10 +109,7 @@ impl ContextExt for TokioRuntime {
109109
110110 fn get_task_locals ( ) -> Option < TaskLocals > {
111111 TASK_LOCALS
112- . try_with ( |c| {
113- c. get ( )
114- . map ( |locals| locals. clone ( ) )
115- } )
112+ . try_with ( |c| c. get ( ) . map ( |locals| locals. clone ( ) ) )
116113 . unwrap_or_default ( )
117114 }
118115}
You can’t perform that action at this time.
0 commit comments