mirror of
https://git.asonix.dog/asonix/pict-rs
synced 2024-12-22 11:21:24 +00:00
Simplify Streamer
This commit is contained in:
parent
95637fdfe5
commit
b28cc38c38
1 changed files with 3 additions and 6 deletions
|
@ -139,12 +139,9 @@ impl<S> Streamer<S> {
|
||||||
where
|
where
|
||||||
S: Stream + Unpin,
|
S: Stream + Unpin,
|
||||||
{
|
{
|
||||||
let opt = match self.0 {
|
let stream = self.0.as_mut().take()?;
|
||||||
Some(ref mut stream) => {
|
|
||||||
std::future::poll_fn(|cx| Pin::new(&mut *stream).poll_next(cx)).await
|
let opt = std::future::poll_fn(|cx| Pin::new(&mut *stream).poll_next(cx)).await;
|
||||||
}
|
|
||||||
None => None,
|
|
||||||
};
|
|
||||||
|
|
||||||
if opt.is_none() {
|
if opt.is_none() {
|
||||||
self.0.take();
|
self.0.take();
|
||||||
|
|
Loading…
Reference in a new issue