blob: 5649d8dd14c4899fde03e7a75d78bf5309aa4728 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
// non rustfixable, see redundant_closure_call_fixable.rs
#![warn(clippy::redundant_closure_call)]
fn main() {
let mut i = 1;
// lint here
let mut k = (|m| m + 1)(i);
// lint here
k = (|a, b| a * b)(1, 5);
// don't lint these
#[allow(clippy::needless_return)]
(|| return 2)();
(|| -> Option<i32> { None? })();
#[allow(clippy::try_err)]
(|| -> Result<i32, i32> { Err(2)? })();
}
|