You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm getting an odd dead_code warning when im obviously using key in the Ready(Ok(svc)) branch. I think this has to do with the pin-project macro.
#[pin_project]#[derive(Debug)]structUnreadyService<K,S,Req>{// This is a false positive// this is warning that it is unusedkey:Option<K>,#[pin]cancel: oneshot::Receiver<()>,#[pin]ready:Ready<S,Req>,}impl<K,S:Service<Req>,Req>FutureforUnreadyService<K,S,Req>{typeOutput = Result<(K,S),(K,Error<S::Error>)>;fnpoll(mutself:Pin<&mutSelf>,cx:&mutContext<'_>) -> Poll<Self::Output>{let me = self.project();ifletPoll::Ready(Ok(())) = me.cancel.poll(cx){let key = self.key.take().expect("polled after ready");returnPoll::Ready(Err((key,Error::Canceled)));}match me.ready.poll(cx){Poll::Pending => Poll::Pending,Poll::Ready(Ok(svc)) => {// but it is used herelet key = self.key.take().expect("polled after ready");Ok((key, svc)).into()}Poll::Ready(Err(e)) => {let key = self.key.take().expect("polled after ready");Err((key,Error::Inner(e))).into()}}}}
The text was updated successfully, but these errors were encountered:
I'm getting an odd dead_code warning when im obviously using key in the
Ready(Ok(svc))
branch. I think this has to do with the pin-project macro.The text was updated successfully, but these errors were encountered: