We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 321a6c8 commit 0cd6466Copy full SHA for 0cd6466
1 file changed
src/lib.rs
@@ -598,7 +598,7 @@ pub trait StreamingIteratorMut: StreamingIterator {
598
fn flatten(self) -> Flatten<Self>
599
where
600
Self: Sized,
601
- Self::Item: StreamingIterator + Sized,
+ Self::Item: StreamingIterator,
602
{
603
Flatten {
604
iter: self,
@@ -2599,6 +2599,20 @@ mod test {
2599
test(it, &[1, 2, 3]);
2600
}
2601
2602
+ #[test]
2603
+ fn flatten_unsized() {
2604
+ type DynI32 = dyn StreamingIterator<Item = i32>;
2605
+ let mut items = [
2606
+ &mut once(1) as &mut DynI32,
2607
+ &mut empty(),
2608
+ &mut convert(2..=3),
2609
+ ];
2610
+ let iters = items.iter_mut().map(|iter| &mut **iter);
2611
+ let it = convert_mut(iters).flatten();
2612
+
2613
+ test(it, &[1, 2, 3]);
2614
+ }
2615
2616
#[test]
2617
fn nth() {
2618
let items = [0, 1];
0 commit comments