]> git.lizzy.rs Git - rust.git/blob - tests/ui/methods.stderr
iterate List by value
[rust.git] / tests / ui / methods.stderr
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
3    |
4 LL | /     pub fn add(self, other: T) -> T {
5 LL | |         self
6 LL | |     }
7    | |_____^
8    |
9    = note: `-D clippy::should-implement-trait` implied by `-D warnings`
10
11 error: methods called `new` usually return `Self`
12   --> $DIR/methods.rs:169:5
13    |
14 LL | /     fn new() -> i32 {
15 LL | |         0
16 LL | |     }
17    | |_____^
18    |
19    = note: `-D clippy::new-ret-no-self` implied by `-D warnings`
20
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
23    |
24 LL |     let _ = v.iter().filter(|&x| *x < 0).next();
25    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
26    |
27    = note: `-D clippy::filter-next` implied by `-D warnings`
28    = note: replace `filter(|&x| *x < 0).next()` with `find(|&x| *x < 0)`
29
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
32    |
33 LL |       let _ = v.iter().filter(|&x| {
34    |  _____________^
35 LL | |                                 *x < 0
36 LL | |                             }
37 LL | |                    ).next();
38    | |___________________________^
39
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
42    |
43 LL |     let _ = v.iter().find(|&x| *x < 0).is_some();
44    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `any(|x| *x < 0)`
45    |
46    = note: `-D clippy::search-is-some` implied by `-D warnings`
47
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
50    |
51 LL |     let _ = (0..1).find(|x| **y == *x).is_some(); // one dereference less
52    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `any(|x| **y == x)`
53
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
56    |
57 LL |     let _ = (0..1).find(|x| *x == 0).is_some();
58    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `any(|x| x == 0)`
59
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
62    |
63 LL |     let _ = v.iter().find(|x| **x == 0).is_some();
64    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `any(|x| *x == 0)`
65
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
68    |
69 LL |       let _ = v.iter().find(|&x| {
70    |  _____________^
71 LL | |                               *x < 0
72 LL | |                           }
73 LL | |                    ).is_some();
74    | |______________________________^
75
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
78    |
79 LL |     let _ = v.iter().position(|&x| x < 0).is_some();
80    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `any(|&x| x < 0)`
81
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
84    |
85 LL |       let _ = v.iter().position(|&x| {
86    |  _____________^
87 LL | |                                   x < 0
88 LL | |                               }
89 LL | |                    ).is_some();
90    | |______________________________^
91
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
94    |
95 LL |     let _ = v.iter().rposition(|&x| x < 0).is_some();
96    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `any(|&x| x < 0)`
97
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
100    |
101 LL |       let _ = v.iter().rposition(|&x| {
102    |  _____________^
103 LL | |                                    x < 0
104 LL | |                                }
105 LL | |                    ).is_some();
106    | |______________________________^
107
108 error: aborting due to 13 previous errors
109