File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -18,16 +18,16 @@ impl bool {
1818 /// assert_eq!(false.then_some(0), None);
1919 /// assert_eq!(true.then_some(0), Some(0));
2020 /// ```
21- ///
21+ ///
2222 /// ```
2323 /// let mut a = 0;
2424 /// let mut function_with_side_effects = || { a += 1; };
25- ///
25+ ///
2626 /// true.then_some(function_with_side_effects());
2727 /// false.then_some(function_with_side_effects());
28- ///
29- /// // `a` is incremented twice because the value passed to `then_some` is
30- /// // evaluated eagerly.
28+ ///
29+ /// // `a` is incremented twice because the value passed to `then_some` is
30+ /// // evaluated eagerly.
3131 /// assert_eq!(a, 2);
3232 /// ```
3333 #[ stable( feature = "bool_to_option" , since = "1.62.0" ) ]
@@ -49,14 +49,14 @@ impl bool {
4949 /// assert_eq!(false.then(|| 0), None);
5050 /// assert_eq!(true.then(|| 0), Some(0));
5151 /// ```
52- ///
52+ ///
5353 /// ```
5454 /// let mut a = 0;
55- ///
55+ ///
5656 /// true.then(|| { a += 1; });
5757 /// false.then(|| { a += 1; });
58- ///
59- /// // `a` is incremented once because the closure is evaluated lazily by
58+ ///
59+ /// // `a` is incremented once because the closure is evaluated lazily by
6060 /// // `then`.
6161 /// ```
6262 #[ stable( feature = "lazy_bool_to_option" , since = "1.50.0" ) ]
You can’t perform that action at this time.
0 commit comments