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: this expression borrows a reference that is immediately dereferenced by the compiler
18 LL | all(&[1, 2, 3], &&2, |x, y| below(x, y)); //is adjusted
19 | ^^^ help: change this to: `&2`
21 = note: `-D clippy::needless-borrow` implied by `-D warnings`
23 error: redundant closure found
26 LL | let e = Some(1u8).map(|a| generic(a));
27 | ^^^^^^^^^^^^^^ help: remove closure as shown: `generic`
29 error: redundant closure found
32 LL | let e = Some(TestStruct { some_ref: &i }).map(|a| a.foo());
33 | ^^^^^^^^^^^ help: remove closure as shown: `TestStruct::foo`
35 = note: `-D clippy::redundant-closure-for-method-calls` implied by `-D warnings`
37 error: redundant closure found
40 LL | let e = Some(TestStruct { some_ref: &i }).map(|a| a.trait_foo());
41 | ^^^^^^^^^^^^^^^^^ help: remove closure as shown: `TestTrait::trait_foo`
43 error: redundant closure found
46 LL | let e = Some(&mut vec![1, 2, 3]).map(|v| v.clear());
47 | ^^^^^^^^^^^^^ help: remove closure as shown: `std::vec::Vec::clear`
49 error: redundant closure found
52 LL | let e = Some("str").map(|s| s.to_string());
53 | ^^^^^^^^^^^^^^^^^ help: remove closure as shown: `std::string::ToString::to_string`
55 error: redundant closure found
58 LL | let e = Some('a').map(|s| s.to_uppercase());
59 | ^^^^^^^^^^^^^^^^^^^^ help: remove closure as shown: `char::to_uppercase`
61 error: redundant closure found
64 LL | let e: std::vec::Vec<char> = vec!['a', 'b', 'c'].iter().map(|c| c.to_ascii_uppercase()).collect();
65 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove closure as shown: `char::to_ascii_uppercase`
67 error: redundant closure found
68 --> $DIR/eta.rs:172:27
70 LL | let a = Some(1u8).map(|a| foo_ptr(a));
71 | ^^^^^^^^^^^^^^ help: remove closure as shown: `foo_ptr`
73 error: redundant closure found
74 --> $DIR/eta.rs:177:27
76 LL | let a = Some(1u8).map(|a| closure(a));
77 | ^^^^^^^^^^^^^^ help: remove closure as shown: `closure`
79 error: aborting due to 12 previous errors