Skip to content

Commit 6529b08

Browse files
author
Adam-Gleave
committed
Document eager evaluation of bool::then_some argument
1 parent fce59c2 commit 6529b08

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

core/src/bool.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ impl bool {
66
/// Returns `Some(t)` if the `bool` is [`true`](../std/keyword.true.html),
77
/// or `None` otherwise.
88
///
9+
/// Arguments passed to `then_some` are eagerly evaluated; if you are
10+
/// passing the result of a function call, it is recommended to use
11+
/// [`then`], which is lazily evaluated.
12+
///
13+
/// [`then`]: bool::then
14+
///
915
/// # Examples
1016
///
1117
/// ```

0 commit comments

Comments
 (0)