@@ -138,25 +138,22 @@ impl<T, U> Clone for UnboundedSender<T, U> {
138138 }
139139}
140140
141- #[ pin_project:: pin_project( PinnedDrop ) ]
142141pub ( crate ) struct Receiver < T , U > {
143- #[ pin]
144142 inner : mpsc:: UnboundedReceiver < Envelope < T , U > > ,
145143 taker : want:: Taker ,
146144}
147145
148146impl < T , U > Receiver < T , U > {
149- pub ( crate ) fn poll_next (
150- self : Pin < & mut Self > ,
147+ pub ( crate ) fn poll_recv (
148+ & mut self ,
151149 cx : & mut task:: Context < ' _ > ,
152150 ) -> Poll < Option < ( T , Callback < T , U > ) > > {
153- let mut this = self . project ( ) ;
154- match this. inner . poll_recv ( cx) {
151+ match self . inner . poll_recv ( cx) {
155152 Poll :: Ready ( item) => {
156153 Poll :: Ready ( item. map ( |mut env| env. 0 . take ( ) . expect ( "envelope not dropped" ) ) )
157154 }
158155 Poll :: Pending => {
159- this . taker . want ( ) ;
156+ self . taker . want ( ) ;
160157 Poll :: Pending
161158 }
162159 }
@@ -177,12 +174,11 @@ impl<T, U> Receiver<T, U> {
177174 }
178175}
179176
180- #[ pin_project:: pinned_drop]
181- impl < T , U > PinnedDrop for Receiver < T , U > {
182- fn drop ( mut self : Pin < & mut Self > ) {
177+ impl < T , U > Drop for Receiver < T , U > {
178+ fn drop ( & mut self ) {
183179 // Notify the giver about the closure first, before dropping
184180 // the mpsc::Receiver.
185- self . as_mut ( ) . taker . cancel ( ) ;
181+ self . taker . cancel ( ) ;
186182 }
187183}
188184
@@ -279,8 +275,8 @@ mod tests {
279275 impl < T , U > Future for Receiver < T , U > {
280276 type Output = Option < ( T , Callback < T , U > ) > ;
281277
282- fn poll ( self : Pin < & mut Self > , cx : & mut Context < ' _ > ) -> Poll < Self :: Output > {
283- self . poll_next ( cx)
278+ fn poll ( mut self : Pin < & mut Self > , cx : & mut Context < ' _ > ) -> Poll < Self :: Output > {
279+ self . poll_recv ( cx)
284280 }
285281 }
286282
0 commit comments