File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ use crate::ops::Try;
33/// Used to make try_fold closures more like normal loops
44#[ unstable( feature = "control_flow_enum" , reason = "new API" , issue = "75744" ) ]
55#[ derive( Debug , Clone , Copy , PartialEq ) ]
6+ #[ must_use = "this `ControlFlow` may be a `Break` variant, which should be handled" ]
67pub enum ControlFlow < C , B > {
78 /// Continue in the loop, using the given value for the next iteration
89 Continue ( C ) ,
@@ -99,7 +100,7 @@ impl<C> ControlFlow<C, ()> {
99100 /// use std::ops::ControlFlow;
100101 ///
101102 /// let mut partial_sum = 0;
102- /// (1..10).chain(20..25).try_for_each(|x| {
103+ /// let _ = (1..10).chain(20..25).try_for_each(|x| {
103104 /// if partial_sum > 100 { ControlFlow::BREAK }
104105 /// else { partial_sum += x; ControlFlow::CONTINUE }
105106 /// });
You can’t perform that action at this time.
0 commit comments