aboutsummaryrefslogtreecommitdiff
path: root/src/stream/poll_fn.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/stream/poll_fn.rs')
-rw-r--r--src/stream/poll_fn.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/stream/poll_fn.rs b/src/stream/poll_fn.rs
index e33ca57..b9bd7d1 100644
--- a/src/stream/poll_fn.rs
+++ b/src/stream/poll_fn.rs
@@ -1,5 +1,6 @@
//! Definition of the `PollFn` combinator
+use super::assert_stream;
use core::fmt;
use core::pin::Pin;
use futures_core::stream::Stream;
@@ -41,7 +42,7 @@ pub fn poll_fn<T, F>(f: F) -> PollFn<F>
where
F: FnMut(&mut Context<'_>) -> Poll<Option<T>>,
{
- PollFn { f }
+ assert_stream::<T, _>(PollFn { f })
}
impl<T, F> Stream for PollFn<F>