Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion library/core/src/ops/control_flow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use crate::ops::Try;
/// Used to make try_fold closures more like normal loops
#[unstable(feature = "control_flow_enum", reason = "new API", issue = "75744")]
#[derive(Debug, Clone, Copy, PartialEq)]
#[must_use = "this `ControlFlow` may be a `Break` variant, which should be handled"]
pub enum ControlFlow<C, B> {
/// Continue in the loop, using the given value for the next iteration
Continue(C),
Expand Down Expand Up @@ -99,7 +100,7 @@ impl<C> ControlFlow<C, ()> {
/// use std::ops::ControlFlow;
///
/// let mut partial_sum = 0;
/// (1..10).chain(20..25).try_for_each(|x| {
/// let _ = (1..10).chain(20..25).try_for_each(|x| {
/// if partial_sum > 100 { ControlFlow::BREAK }
/// else { partial_sum += x; ControlFlow::CONTINUE }
/// });
Expand Down