We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
filter_map_bool_then
1 parent 7bc30a7 commit 925c1c4Copy full SHA for 925c1c4
core/src/bool.rs
@@ -55,6 +55,7 @@ impl bool {
55
/// assert_eq!(a, 1);
56
/// ```
57
#[stable(feature = "lazy_bool_to_option", since = "1.50.0")]
58
+ #[cfg_attr(not(test), rustc_diagnostic_item = "bool_then")]
59
#[inline]
60
pub fn then<T, F: FnOnce() -> T>(self, f: F) -> Option<T> {
61
if self { Some(f()) } else { None }
0 commit comments