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