File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 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};
77/// Having the enum makes it clearer -- no more wondering "wait, what did `false`
88/// mean again?" -- and allows including a value.
99///
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+ ///
1014/// # Examples
1115///
1216/// Early-exiting from [`Iterator::try_for_each`]:
@@ -71,6 +75,9 @@ use crate::{convert, ops};
7175/// assert_eq!(res, ControlFlow::Break(-1));
7276/// assert_eq!(sum, 6);
7377/// ```
78+ ///
79+ /// [`Break`]: ControlFlow::Break
80+ /// [`Continue`]: ControlFlow::Continue
7481#[ stable( feature = "control_flow_enum_type" , since = "1.55.0" ) ]
7582#[ derive( Debug , Clone , Copy , PartialEq ) ]
7683pub enum ControlFlow < B , C = ( ) > {
You can’t perform that action at this time.
0 commit comments