Skip to content

Commit aa784fc

Browse files
authored
Implement Stream::size_hint() for Either (#2325)
1 parent 0ae6d1e commit aa784fc

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

futures-util/src/future/either.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,13 @@ where
101101
Either::Right(x) => x.poll_next(cx),
102102
}
103103
}
104+
105+
fn size_hint(&self) -> (usize, Option<usize>) {
106+
match self {
107+
Either::Left(x) => x.size_hint(),
108+
Either::Right(x) => x.size_hint(),
109+
}
110+
}
104111
}
105112

106113
impl<A, B> FusedStream for Either<A, B>

0 commit comments

Comments
 (0)