File tree 1 file changed +2
-1
lines changed
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;
3
3
/// Used to make try_fold closures more like normal loops
4
4
#[ unstable( feature = "control_flow_enum" , reason = "new API" , issue = "75744" ) ]
5
5
#[ derive( Debug , Clone , Copy , PartialEq ) ]
6
+ #[ must_use = "this `ControlFlow` may be a `Break` variant, which should be handled" ]
6
7
pub enum ControlFlow < C , B > {
7
8
/// Continue in the loop, using the given value for the next iteration
8
9
Continue ( C ) ,
@@ -99,7 +100,7 @@ impl<C> ControlFlow<C, ()> {
99
100
/// use std::ops::ControlFlow;
100
101
///
101
102
/// 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| {
103
104
/// if partial_sum > 100 { ControlFlow::BREAK }
104
105
/// else { partial_sum += x; ControlFlow::CONTINUE }
105
106
/// });
You can’t perform that action at this time.
0 commit comments