rust-lang / futures-rs

Zero-cost asynchronous programming in Rust
https://rust-lang.github.io/futures-rs/
Apache License 2.0
5.38k stars 622 forks source link

Behavior of any() / all() / try_any() / try_all() is not documented for empty stream #2847

Open johntconklin opened 6 months ago

johntconklin commented 6 months ago

Unlike std::any() and std::all(), the behavior of these functions for empty streams does not seem to be documented.

Experimentally, they behave the same (for all()/try_all(), an empty iterator returns true / Ok(true); for any()/try_any(), an empty stream returns false / Ok(false)). Documentation should make it explicit.