1
1
use crate :: ops:: Try ;
2
2
3
3
/// Used to make try_fold closures more like normal loops
4
- #[ unstable( feature= "control_flow_enum" , reason= "new API" , issue= "75744" ) ]
4
+ #[ unstable( feature = "control_flow_enum" , reason = "new API" , issue = "75744" ) ]
5
5
#[ derive( Debug , Clone , Copy , PartialEq ) ]
6
6
pub enum ControlFlow < C , B > {
7
7
/// Continue in the loop, using the given value for the next iteration
@@ -10,7 +10,7 @@ pub enum ControlFlow<C, B> {
10
10
Break ( B ) ,
11
11
}
12
12
13
- #[ unstable( feature= "control_flow_enum" , reason= "new API" , issue= "75744" ) ]
13
+ #[ unstable( feature = "control_flow_enum" , reason = "new API" , issue = "75744" ) ]
14
14
impl < C , B > Try for ControlFlow < C , B > {
15
15
type Ok = C ;
16
16
type Error = B ;
@@ -35,7 +35,7 @@ impl<C, B> ControlFlow<C, B> {
35
35
/// Converts the `ControlFlow` into an `Option` which is `Some` if the
36
36
/// `ControlFlow` was `Break` and `None` otherwise.
37
37
#[ inline]
38
- #[ unstable( feature= "control_flow_enum" , reason= "new API" , issue= "75744" ) ]
38
+ #[ unstable( feature = "control_flow_enum" , reason = "new API" , issue = "75744" ) ]
39
39
pub fn break_value ( self ) -> Option < B > {
40
40
match self {
41
41
ControlFlow :: Continue ( ..) => None ,
@@ -46,7 +46,7 @@ impl<C, B> ControlFlow<C, B> {
46
46
47
47
impl < R : Try > ControlFlow < R :: Ok , R > {
48
48
/// Create a `ControlFlow` from any type implementing `Try`.
49
- #[ unstable( feature= "control_flow_enum" , reason= "new API" , issue= "75744" ) ]
49
+ #[ unstable( feature = "control_flow_enum" , reason = "new API" , issue = "75744" ) ]
50
50
#[ inline]
51
51
pub fn from_try ( r : R ) -> Self {
52
52
match Try :: into_result ( r) {
@@ -56,7 +56,7 @@ impl<R: Try> ControlFlow<R::Ok, R> {
56
56
}
57
57
58
58
/// Convert a `ControlFlow` into any type implementing `Try`;
59
- #[ unstable( feature= "control_flow_enum" , reason= "new API" , issue= "75744" ) ]
59
+ #[ unstable( feature = "control_flow_enum" , reason = "new API" , issue = "75744" ) ]
60
60
#[ inline]
61
61
pub fn into_try ( self ) -> R {
62
62
match self {
0 commit comments