1 error: redundant closure found
4 LL | let a = Some(1u8).map(|a| foo(a));
5 | ^^^^^^^^^^ help: remove closure as shown: `foo`
7 = note: `-D clippy::redundant-closure` implied by `-D warnings`
9 error: redundant closure found
12 LL | meta(|a| foo(a));
13 | ^^^^^^^^^^ help: remove closure as shown: `foo`
15 error: redundant closure found
18 LL | let c = Some(1u8).map(|a| {1+2; foo}(a));
19 | ^^^^^^^^^^^^^^^^^ help: remove closure as shown: `{1+2; foo}`
21 error: this expression borrows a reference that is immediately dereferenced by the compiler
24 LL | all(&[1, 2, 3], &&2, |x, y| below(x, y)); //is adjusted
25 | ^^^ help: change this to: `&2`
27 = note: `-D clippy::needless-borrow` implied by `-D warnings`
29 error: redundant closure found
32 LL | let e = Some(1u8).map(|a| generic(a));
33 | ^^^^^^^^^^^^^^ help: remove closure as shown: `generic`
35 error: redundant closure found
38 LL | let e = Some(TestStruct { some_ref: &i }).map(|a| a.foo());
39 | ^^^^^^^^^^^ help: remove closure as shown: `TestStruct::foo`
41 error: redundant closure found
44 LL | let e = Some(TestStruct { some_ref: &i }).map(|a| a.trait_foo());
45 | ^^^^^^^^^^^^^^^^^ help: remove closure as shown: `TestTrait::trait_foo`
47 error: redundant closure found
50 LL | let e = Some(&mut vec![1, 2, 3]).map(|v| v.clear());
51 | ^^^^^^^^^^^^^ help: remove closure as shown: `std::vec::Vec::clear`
53 error: redundant closure found
56 LL | let e = Some("str").map(|s| s.to_string());
57 | ^^^^^^^^^^^^^^^^^ help: remove closure as shown: `std::string::ToString::to_string`
59 error: redundant closure found
62 LL | let e = Some('a').map(|s| s.to_uppercase());
63 | ^^^^^^^^^^^^^^^^^^^^ help: remove closure as shown: `char::to_uppercase`
65 error: redundant closure found
68 LL | let e: std::vec::Vec<char> = vec!['a', 'b', 'c'].iter().map(|c| c.to_ascii_uppercase()).collect();
69 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove closure as shown: `char::to_ascii_uppercase`
71 error: aborting due to 11 previous errors