ready-cache: restore assert for dropped cancel tx
When ready-cache was upgraded from futures 0.1 to `std::future` in
e2f1a49cf3
, this `expect` was removed, and
the code instead silently ignores the error. That's probably not what we
want, so this patch restores that assertion.
This commit is contained in:
parent
1a67100aab
commit
be156e733d
|
@ -363,7 +363,8 @@ where
|
||||||
|
|
||||||
fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
|
fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
|
||||||
let mut fut = self.cancel.as_mut().expect("polled after complete");
|
let mut fut = self.cancel.as_mut().expect("polled after complete");
|
||||||
if let Poll::Ready(Ok(_)) = Pin::new(&mut fut).poll(cx) {
|
if let Poll::Ready(r) = Pin::new(&mut fut).poll(cx) {
|
||||||
|
assert!(r.is_ok(), "cancel sender lost");
|
||||||
let key = self.key.take().expect("polled after complete");
|
let key = self.key.take().expect("polled after complete");
|
||||||
return Err(PendingError::Canceled(key)).into();
|
return Err(PendingError::Canceled(key)).into();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue