[Clippy] Swap filter_map_bool_then to use diagnostic item instead o… · qinheping/verify-rust-std@925c1c4 (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Commit 925c1c4

[Clippy] Swap filter_map_bool_then to use diagnostic item instead of path

File tree

1 file changed

lines changed

1 file changed

lines changed

Original file line number Diff line number Diff line change
@@ -55,6 +55,7 @@ impl bool {
55 55 /// assert_eq!(a, 1);
56 56 /// ```
57 57 #[stable(feature = "lazy_bool_to_option", since = "1.50.0")]
58 +#[cfg_attr(not(test), rustc_diagnostic_item = "bool_then")]
58 59 #[inline]
59 60 pub fn then<T, F: FnOnce() -> T>(self, f: F) -> Option<T> {
60 61 if self { Some(f()) } else { None }