use ergonomic try_next() combinator instead of transpose()

This commit is contained in:
Tangent 2020-05-09 00:17:22 -04:00
parent 5a6d1e764d
commit d585ad7b31
2 changed files with 3 additions and 3 deletions

View file

@ -1,5 +1,5 @@
use bytes::{Buf, BufMut, Bytes, BytesMut};
use futures::stream::{Stream, StreamExt};
use futures::{TryStreamExt, stream::{Stream, StreamExt}};
use std::task::{Context, Poll};
use crate::ebml::FromEbml;
@ -93,7 +93,7 @@ where
}
}
match self.stream.next().await.transpose()? {
match self.stream.try_next().await? {
Some(refill) => {
self.buffer.reserve(refill.remaining());
self.buffer.put(refill);