File tree 1 file changed +7
-0
lines changed
1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,10 @@ use crate::{convert, ops};
7
7
/// Having the enum makes it clearer -- no more wondering "wait, what did `false`
8
8
/// mean again?" -- and allows including a value.
9
9
///
10
+ /// Similar to [`Option`] and [`Result`], this enum can be used with the `?` operator
11
+ /// to return immediately if the [`Break`] variant is present or otherwise continue normally
12
+ /// with the value inside the [`Continue`] variant.
13
+ ///
10
14
/// # Examples
11
15
///
12
16
/// Early-exiting from [`Iterator::try_for_each`]:
@@ -71,6 +75,9 @@ use crate::{convert, ops};
71
75
/// assert_eq!(res, ControlFlow::Break(-1));
72
76
/// assert_eq!(sum, 6);
73
77
/// ```
78
+ ///
79
+ /// [`Break`]: ControlFlow::Break
80
+ /// [`Continue`]: ControlFlow::Continue
74
81
#[ stable( feature = "control_flow_enum_type" , since = "1.55.0" ) ]
75
82
#[ derive( Debug , Clone , Copy , PartialEq ) ]
76
83
pub enum ControlFlow < B , C = ( ) > {
You can’t perform that action at this time.
0 commit comments