Skip to content

Commit

Permalink
Implement Stream::size_hint() for Either (#2325)
Browse files Browse the repository at this point in the history
  • Loading branch information
benkay86 committed Jan 19, 2021
1 parent 0ae6d1e commit aa784fc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions futures-util/src/future/either.rs
Expand Up @@ -101,6 +101,13 @@ where
Either::Right(x) => x.poll_next(cx),
}
}

fn size_hint(&self) -> (usize, Option<usize>) {
match self {
Either::Left(x) => x.size_hint(),
Either::Right(x) => x.size_hint(),
}
}
}

impl<A, B> FusedStream for Either<A, B>
Expand Down

0 comments on commit aa784fc

Please sign in to comment.