Skip to content

Commit

Permalink
Conditionalize cancel-safety on Future cancel safety
Browse files Browse the repository at this point in the history
  • Loading branch information
akonradi-signal committed Dec 2, 2024
1 parent 8a75b98 commit ea5b0ea
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions futures-util/src/stream/futures_unordered/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,11 @@ use self::ready_to_run_queue::{Dequeue, ReadyToRunQueue};
///
/// # Cancel safety
///
/// This type is cancellation-safe. If [`poll_next`](Stream::poll_next) is
/// called (either directly or via [`crate::StreamExt::next`]) and it returns
/// [`Poll::Pending`], no values will be dropped if `poll_next` is not called
/// again.
/// This type is cancellation-safe when the inner [`Future`] is
/// cancellation-safe. If the future type is cancellation-safe, and
/// [`poll_next`](Stream::poll_next) is called (either directly or via
/// [`crate::StreamExt::next`]) and returns [`Poll::Pending`], no values will be
/// dropped if `poll_next` is not called again.
#[must_use = "streams do nothing unless polled"]
pub struct FuturesUnordered<Fut> {
ready_to_run_queue: Arc<ReadyToRunQueue<Fut>>,
Expand Down

0 comments on commit ea5b0ea

Please sign in to comment.