|
1 | 1 | use super::Compat;
|
2 | 2 | use futures::{
|
3 |
| - task as task01, Async as Async01, AsyncSink as AsyncSink01, Future as Future01, Poll as Poll01, |
4 |
| - Sink as Sink01, StartSend as StartSend01, Stream as Stream01, |
| 3 | + task as task01, Async as Async01, AsyncSink as AsyncSink01, |
| 4 | + Future as Future01, Poll as Poll01, Sink as Sink01, |
| 5 | + StartSend as StartSend01, Stream as Stream01, |
| 6 | +}; |
| 7 | +use futures_core::{ |
| 8 | + task as task03, TryFuture as TryFuture03, TryStream as TryStream03, |
5 | 9 | };
|
6 |
| -use futures_core::{task as task03, TryFuture as TryFuture03, TryStream as TryStream03}; |
7 | 10 | use futures_sink::Sink as Sink03;
|
8 | 11 | use std::{marker::Unpin, mem::PinMut, sync::Arc};
|
9 | 12 |
|
@@ -50,10 +53,15 @@ where
|
50 | 53 | type SinkItem = T::SinkItem;
|
51 | 54 | type SinkError = T::SinkError;
|
52 | 55 |
|
53 |
| - fn start_send(&mut self, item: Self::SinkItem) -> StartSend01<Self::SinkItem, Self::SinkError> { |
| 56 | + fn start_send( |
| 57 | + &mut self, |
| 58 | + item: Self::SinkItem, |
| 59 | + ) -> StartSend01<Self::SinkItem, Self::SinkError> { |
54 | 60 | with_context(self, |mut inner, cx| {
|
55 | 61 | match inner.reborrow().poll_ready(cx) {
|
56 |
| - task03::Poll::Ready(Ok(())) => inner.start_send(item).map(|()| AsyncSink01::Ready), |
| 62 | + task03::Poll::Ready(Ok(())) => { |
| 63 | + inner.start_send(item).map(|()| AsyncSink01::Ready) |
| 64 | + } |
57 | 65 | task03::Poll::Pending => Ok(AsyncSink01::NotReady(item)),
|
58 | 66 | task03::Poll::Ready(Err(e)) => Err(e),
|
59 | 67 | }
|
|
97 | 105 | F: FnOnce(PinMut<T>, &mut task03::Context) -> R,
|
98 | 106 | {
|
99 | 107 | let waker = current_as_waker();
|
100 |
| - let mut cx = task03::Context::new(&waker, compat.executor.as_mut().unwrap()); |
| 108 | + let executor = compat.executor.as_mut().unwrap(); |
| 109 | + let mut cx = task03::Context::new(&waker, executor); |
101 | 110 | f(PinMut::new(&mut compat.inner), &mut cx)
|
102 | 111 | }
|
0 commit comments