1 error: defining a method called `add` on this type; consider implementing the `std::ops::Add` trait or choosing a less ambiguous name
2 --> $DIR/methods.rs:39:5
4 LL | / pub fn add(self, other: T) -> T {
9 = note: `-D clippy::should-implement-trait` implied by `-D warnings`
11 error: methods called `new` usually return `Self`
12 --> $DIR/methods.rs:169:5
14 LL | / fn new() -> i32 {
19 = note: `-D clippy::new-ret-no-self` implied by `-D warnings`
21 error: called `filter(p).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(p)` instead.
22 --> $DIR/methods.rs:188:13
24 LL | let _ = v.iter().filter(|&x| *x < 0).next();
25 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
27 = note: `-D clippy::filter-next` implied by `-D warnings`
28 = note: replace `filter(|&x| *x < 0).next()` with `find(|&x| *x < 0)`
30 error: called `filter(p).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(p)` instead.
31 --> $DIR/methods.rs:191:13
33 LL | let _ = v.iter().filter(|&x| {
38 | |___________________________^
40 error: called `is_some()` after searching an `Iterator` with find. This is more succinctly expressed by calling `any()`.
41 --> $DIR/methods.rs:208:22
43 LL | let _ = v.iter().find(|&x| *x < 0).is_some();
44 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `any(|x| *x < 0)`
46 = note: `-D clippy::search-is-some` implied by `-D warnings`
48 error: called `is_some()` after searching an `Iterator` with find. This is more succinctly expressed by calling `any()`.
49 --> $DIR/methods.rs:209:20
51 LL | let _ = (0..1).find(|x| **y == *x).is_some(); // one dereference less
52 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `any(|x| **y == x)`
54 error: called `is_some()` after searching an `Iterator` with find. This is more succinctly expressed by calling `any()`.
55 --> $DIR/methods.rs:210:20
57 LL | let _ = (0..1).find(|x| *x == 0).is_some();
58 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `any(|x| x == 0)`
60 error: called `is_some()` after searching an `Iterator` with find. This is more succinctly expressed by calling `any()`.
61 --> $DIR/methods.rs:211:22
63 LL | let _ = v.iter().find(|x| **x == 0).is_some();
64 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `any(|x| *x == 0)`
66 error: called `is_some()` after searching an `Iterator` with find. This is more succinctly expressed by calling `any()`.
67 --> $DIR/methods.rs:214:13
69 LL | let _ = v.iter().find(|&x| {
74 | |______________________________^
76 error: called `is_some()` after searching an `Iterator` with position. This is more succinctly expressed by calling `any()`.
77 --> $DIR/methods.rs:220:22
79 LL | let _ = v.iter().position(|&x| x < 0).is_some();
80 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `any(|&x| x < 0)`
82 error: called `is_some()` after searching an `Iterator` with position. This is more succinctly expressed by calling `any()`.
83 --> $DIR/methods.rs:223:13
85 LL | let _ = v.iter().position(|&x| {
90 | |______________________________^
92 error: called `is_some()` after searching an `Iterator` with rposition. This is more succinctly expressed by calling `any()`.
93 --> $DIR/methods.rs:229:22
95 LL | let _ = v.iter().rposition(|&x| x < 0).is_some();
96 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `any(|&x| x < 0)`
98 error: called `is_some()` after searching an `Iterator` with rposition. This is more succinctly expressed by calling `any()`.
99 --> $DIR/methods.rs:232:13
101 LL | let _ = v.iter().rposition(|&x| {
106 | |______________________________^
108 error: aborting due to 13 previous errors