Skip to content

Commit 71a1d17

Browse files
committed
Remove redundant & for waker args in closures
1 parent 287994b commit 71a1d17

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/future.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ pub fn poll_fn<F, T>(f: F) -> impl Future<Output = T>
148148
from_generator(|| {
149149
let mut f = f;
150150
loop {
151-
let poll_result = get_task_waker(|waker: &_| f(waker));
151+
let poll_result = get_task_waker(|waker| f(waker));
152152
match poll_result {
153153
Poll::Pending => yield,
154154
Poll::Ready(value) => return value,

src/stream.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ pub async fn next<St>(stream: &mut St) -> Option<St::Item>
1010
where St: Stream + Unpin,
1111
{
1212
use crate::future::poll_fn;
13-
let poll_next = |waker: &_| Pin::new(&mut *stream).poll_next(waker);
14-
let future_next = poll_fn(poll_next);
13+
let future_next = poll_fn(|waker| Pin::new(&mut *stream).poll_next(waker));
1514
await!(future_next)
1615
}
1716

0 commit comments

Comments
 (0)