1 #![warn(clippy::block_in_if_condition_expr)]
2 #![warn(clippy::block_in_if_condition_stmt)]
3 #![allow(unused, clippy::let_and_return)]
5 fn predicate<F: FnOnce(T) -> bool, T>(pfn: F, val: T) -> bool {
12 // This is a sneaky case, where the block isn't directly in the condition,
13 // but is actually nside a closure that the condition is using.
14 // The same principle applies -- add some extra expressions to make sure
15 // linter isn't confused by them.
36 fn closure_without_block() {
37 if predicate(|x| x == 3, 6) {}
40 fn macro_in_closure() {
41 let option = Some(true);
43 if option.unwrap_or_else(|| unimplemented!()) {