1
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
2
+ --> $DIR/methods.rs:40 :5
3
3
|
4
4
LL | / pub fn add(self, other: T) -> T {
5
5
LL | | self
9
9
= note: `-D clippy::should-implement-trait` implied by `-D warnings`
10
10
11
11
error: methods called `new` usually return `Self`
12
- --> $DIR/methods.rs:169 :5
12
+ --> $DIR/methods.rs:174 :5
13
13
|
14
14
LL | / fn new() -> i32 {
15
15
LL | | 0
@@ -19,7 +19,7 @@ LL | | }
19
19
= note: `-D clippy::new-ret-no-self` implied by `-D warnings`
20
20
21
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
22
+ --> $DIR/methods.rs:193 :13
23
23
|
24
24
LL | let _ = v.iter().filter(|&x| *x < 0).next();
25
25
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -28,7 +28,7 @@ LL | let _ = v.iter().filter(|&x| *x < 0).next();
28
28
= note: replace `filter(|&x| *x < 0).next()` with `find(|&x| *x < 0)`
29
29
30
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
31
+ --> $DIR/methods.rs:196 :13
32
32
|
33
33
LL | let _ = v.iter().filter(|&x| {
34
34
| _____________^
@@ -38,33 +38,33 @@ LL | | ).next();
38
38
| |___________________________^
39
39
40
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
41
+ --> $DIR/methods.rs:213 :22
42
42
|
43
43
LL | let _ = v.iter().find(|&x| *x < 0).is_some();
44
44
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `any(|x| *x < 0)`
45
45
|
46
46
= note: `-D clippy::search-is-some` implied by `-D warnings`
47
47
48
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
49
+ --> $DIR/methods.rs:214 :20
50
50
|
51
51
LL | let _ = (0..1).find(|x| **y == *x).is_some(); // one dereference less
52
52
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `any(|x| **y == x)`
53
53
54
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
55
+ --> $DIR/methods.rs:215 :20
56
56
|
57
57
LL | let _ = (0..1).find(|x| *x == 0).is_some();
58
58
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `any(|x| x == 0)`
59
59
60
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
61
+ --> $DIR/methods.rs:216 :22
62
62
|
63
63
LL | let _ = v.iter().find(|x| **x == 0).is_some();
64
64
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `any(|x| *x == 0)`
65
65
66
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
67
+ --> $DIR/methods.rs:219 :13
68
68
|
69
69
LL | let _ = v.iter().find(|&x| {
70
70
| _____________^
@@ -74,13 +74,13 @@ LL | | ).is_some();
74
74
| |______________________________^
75
75
76
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
77
+ --> $DIR/methods.rs:225 :22
78
78
|
79
79
LL | let _ = v.iter().position(|&x| x < 0).is_some();
80
80
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `any(|&x| x < 0)`
81
81
82
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
83
+ --> $DIR/methods.rs:228 :13
84
84
|
85
85
LL | let _ = v.iter().position(|&x| {
86
86
| _____________^
@@ -90,13 +90,13 @@ LL | | ).is_some();
90
90
| |______________________________^
91
91
92
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
93
+ --> $DIR/methods.rs:234 :22
94
94
|
95
95
LL | let _ = v.iter().rposition(|&x| x < 0).is_some();
96
96
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `any(|&x| x < 0)`
97
97
98
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
99
+ --> $DIR/methods.rs:237 :13
100
100
|
101
101
LL | let _ = v.iter().rposition(|&x| {
102
102
| _____________^
0 commit comments