Skip to content

Commit df75f22

Browse files
taiki-eebkalderon
authored andcommitted
Fix clippy errors
1 parent 4b21bf2 commit df75f22

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

futures-channel/src/mpsc/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ impl<T> SenderInner<T> {
600600
//
601601
// Update the task in case the `Sender` has been moved to another
602602
// task
603-
task.task = waker.map(|waker| waker.clone());
603+
task.task = waker.cloned();
604604

605605
Poll::Pending
606606
} else {

futures-sink/src/channel_impls.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::{Sink, Poll};
22
use futures_core::task::Waker;
3-
use futures_channel::mpsc::{Sender, SendError, UnboundedSender};
3+
use futures_channel::mpsc::{Sender, SendError, TrySendError, UnboundedSender};
44
use std::pin::Pin;
55

66
impl<T> Sink for Sender<T> {
@@ -57,7 +57,7 @@ impl<'a, T> Sink for &'a UnboundedSender<T> {
5757

5858
fn start_send(self: Pin<&mut Self>, msg: T) -> Result<(), Self::SinkError> {
5959
self.unbounded_send(msg)
60-
.map_err(|err| err.into_send_error())
60+
.map_err(TrySendError::into_send_error)
6161
}
6262

6363
fn poll_flush(self: Pin<&mut Self>, _: &Waker) -> Poll<Result<(), Self::SinkError>> {

futures-util/src/compat/compat01as03.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ impl<Fut: Future01> Future03 for Compat01As03<Fut> {
7575
mut self: Pin<&mut Self>,
7676
waker: &Waker,
7777
) -> task03::Poll<Self::Output> {
78-
poll_01_to_03(self.in_notify(waker, |f| f.poll()))
78+
poll_01_to_03(self.in_notify(waker, Future01::poll))
7979
}
8080
}
8181

@@ -86,7 +86,7 @@ impl<St: Stream01> Stream03 for Compat01As03<St> {
8686
mut self: Pin<&mut Self>,
8787
waker: &Waker,
8888
) -> task03::Poll<Option<Self::Item>> {
89-
match self.in_notify(waker, |f| f.poll()) {
89+
match self.in_notify(waker, Stream01::poll) {
9090
Ok(Async01::Ready(Some(t))) => task03::Poll::Ready(Some(Ok(t))),
9191
Ok(Async01::Ready(None)) => task03::Poll::Ready(None),
9292
Ok(Async01::NotReady) => task03::Poll::Pending,
@@ -163,13 +163,13 @@ mod io {
163163
fn poll_flush(&mut self, waker: &task03::Waker)
164164
-> task03::Poll<Result<(), Error>>
165165
{
166-
poll_01_to_03(self.in_notify(waker, |x| x.poll_flush()))
166+
poll_01_to_03(self.in_notify(waker, AsyncWrite01::poll_flush))
167167
}
168168

169169
fn poll_close(&mut self, waker: &task03::Waker)
170170
-> task03::Poll<Result<(), Error>>
171171
{
172-
poll_01_to_03(self.in_notify(waker, |x| x.shutdown()))
172+
poll_01_to_03(self.in_notify(waker, AsyncWrite01::shutdown))
173173
}
174174
}
175175
}

futures-util/src/compat/compat03as01.rs

+1
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ impl Current {
128128

129129
fn as_waker(&self) -> WakerRef<'_> {
130130
unsafe fn ptr_to_current<'a>(ptr: *const ()) -> &'a Current {
131+
#[allow(clippy::cast_ptr_alignment)]
131132
&*(ptr as *const Current)
132133
}
133134
fn current_to_ptr(current: &Current) -> *const () {

0 commit comments

Comments
 (0)