-
Notifications
You must be signed in to change notification settings - Fork 671
Open
Description
Reproducible example
#[test]
fn test() {
use futures::StreamExt;
tokio::runtime::Builder::new_current_thread()
.enable_all()
.build()
.unwrap()
.block_on(async {
futures::stream::iter(0..10)
.map(|x| std::future::ready(x))
.buffered(0)
.next()
.await
.unwrap();
})
}I don't think the current behavior (silently hanging) is ideal, but I'm also not sure of a better alternative - I can think of a few options -
- Take
NonZeroUsize(orTryInto<NonZeroUsize>in the API - Internally clamp
nto be a minimum of 1 - Return
Nonefornext() - Panic
Metadata
Metadata
Assignees
Labels
No labels