@@ -9,12 +9,12 @@ impl bool {
9
9
/// ```
10
10
/// #![feature(bool_to_option)]
11
11
///
12
- /// assert_eq!(false.then (0), None);
13
- /// assert_eq!(true.then (0), Some(0));
12
+ /// assert_eq!(false.to_option (0), None);
13
+ /// assert_eq!(true.to_option (0), Some(0));
14
14
/// ```
15
15
#[ unstable( feature = "bool_to_option" , issue = "64260" ) ]
16
16
#[ inline]
17
- pub fn then < T > ( self , t : T ) -> Option < T > {
17
+ pub fn to_option < T > ( self , t : T ) -> Option < T > {
18
18
if self {
19
19
Some ( t)
20
20
} else {
@@ -29,12 +29,12 @@ impl bool {
29
29
/// ```
30
30
/// #![feature(bool_to_option)]
31
31
///
32
- /// assert_eq!(false.then_with (|| 0), None);
33
- /// assert_eq!(true.then_with (|| 0), Some(0));
32
+ /// assert_eq!(false.to_option_with (|| 0), None);
33
+ /// assert_eq!(true.to_option_with (|| 0), Some(0));
34
34
/// ```
35
35
#[ unstable( feature = "bool_to_option" , issue = "64260" ) ]
36
36
#[ inline]
37
- pub fn then_with < T , F : FnOnce ( ) -> T > ( self , f : F ) -> Option < T > {
37
+ pub fn to_option_with < T , F : FnOnce ( ) -> T > ( self , f : F ) -> Option < T > {
38
38
if self {
39
39
Some ( f ( ) )
40
40
} else {
0 commit comments