Skip to content

Commit 22a36ee

Browse files
authored
Implement Stream::size_hint method on AsyncStream (#40)
1 parent 1c40a5b commit 22a36ee

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

async-stream/src/async_stream.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,12 @@ where
6666
}
6767
}
6868
}
69+
70+
fn size_hint(&self) -> (usize, Option<usize>) {
71+
if self.done {
72+
(0, Some(0))
73+
} else {
74+
(0, None)
75+
}
76+
}
6977
}

0 commit comments

Comments
 (0)