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:
Jon Gjengset 2020-02-20 16:59:10 -05:00
parent 1a67100aab
commit be156e733d
1 changed files with 2 additions and 1 deletions

View File

@ -363,7 +363,8 @@ where
fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
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");
return Err(PendingError::Canceled(key)).into();
}