Skip to content

Commit 86d209f

Browse files
committed
fmt
1 parent c9a60b2 commit 86d209f

File tree

3 files changed

+3
-15
lines changed

3 files changed

+3
-15
lines changed

src/async_std.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff 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
}

src/generic.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1506,12 +1506,7 @@ struct SenderGlue {
15061506
#[pymethods]
15071507
impl 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()

src/tokio.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)