]> git.lizzy.rs Git - rust.git/blob - clippy_tests/examples/map_clone.stderr
5f04a99ce09e69bbe50cb4b5d288d74b9522dfbf
[rust.git] / clippy_tests / examples / map_clone.stderr
1 error: you seem to be using .map() to clone the contents of an iterator, consider using `.cloned()`
2   --> map_clone.rs:12:5
3    |
4 12 |     x.iter().map(|y| y.clone());
5    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
6    |
7    = note: `-D map-clone` implied by `-D warnings`
8    = help: try
9            x.iter().cloned()
10
11 error: you seem to be using .map() to clone the contents of an iterator, consider using `.cloned()`
12   --> map_clone.rs:14:5
13    |
14 14 |     x.iter().map(|&y| y);
15    |     ^^^^^^^^^^^^^^^^^^^^
16    |
17    = note: `-D map-clone` implied by `-D warnings`
18    = help: try
19            x.iter().cloned()
20
21 error: you seem to be using .map() to clone the contents of an iterator, consider using `.cloned()`
22   --> map_clone.rs:16:5
23    |
24 16 |     x.iter().map(|y| *y);
25    |     ^^^^^^^^^^^^^^^^^^^^
26    |
27    = note: `-D map-clone` implied by `-D warnings`
28    = help: try
29            x.iter().cloned()
30
31 error: you seem to be using .map() to clone the contents of an iterator, consider using `.cloned()`
32   --> map_clone.rs:18:5
33    |
34 18 |     x.iter().map(|y| { y.clone() });
35    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
36    |
37    = note: `-D map-clone` implied by `-D warnings`
38    = help: try
39            x.iter().cloned()
40
41 error: you seem to be using .map() to clone the contents of an iterator, consider using `.cloned()`
42   --> map_clone.rs:20:5
43    |
44 20 |     x.iter().map(|&y| { y });
45    |     ^^^^^^^^^^^^^^^^^^^^^^^^
46    |
47    = note: `-D map-clone` implied by `-D warnings`
48    = help: try
49            x.iter().cloned()
50
51 error: you seem to be using .map() to clone the contents of an iterator, consider using `.cloned()`
52   --> map_clone.rs:22:5
53    |
54 22 |     x.iter().map(|y| { *y });
55    |     ^^^^^^^^^^^^^^^^^^^^^^^^
56    |
57    = note: `-D map-clone` implied by `-D warnings`
58    = help: try
59            x.iter().cloned()
60
61 error: you seem to be using .map() to clone the contents of an iterator, consider using `.cloned()`
62   --> map_clone.rs:24:5
63    |
64 24 |     x.iter().map(Clone::clone);
65    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
66    |
67    = note: `-D map-clone` implied by `-D warnings`
68    = help: try
69            x.iter().cloned()
70
71 error: you seem to be using .map() to clone the contents of an Option, consider using `.cloned()`
72   --> map_clone.rs:30:5
73    |
74 30 |     x.as_ref().map(|y| y.clone());
75    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
76    |
77    = note: `-D map-clone` implied by `-D warnings`
78    = help: try
79            x.as_ref().cloned()
80
81 error: you seem to be using .map() to clone the contents of an Option, consider using `.cloned()`
82   --> map_clone.rs:32:5
83    |
84 32 |     x.as_ref().map(|&y| y);
85    |     ^^^^^^^^^^^^^^^^^^^^^^
86    |
87    = note: `-D map-clone` implied by `-D warnings`
88    = help: try
89            x.as_ref().cloned()
90
91 error: you seem to be using .map() to clone the contents of an Option, consider using `.cloned()`
92   --> map_clone.rs:34:5
93    |
94 34 |     x.as_ref().map(|y| *y);
95    |     ^^^^^^^^^^^^^^^^^^^^^^
96    |
97    = note: `-D map-clone` implied by `-D warnings`
98    = help: try
99            x.as_ref().cloned()
100
101 error: you seem to be using .map() to clone the contents of an Option, consider using `.cloned()`
102   --> map_clone.rs:90:35
103    |
104 90 |     let _: Option<UnusualDeref> = x.as_ref().map(|y| *y);
105    |                                   ^^^^^^^^^^^^^^^^^^^^^^
106    |
107    = note: `-D map-clone` implied by `-D warnings`
108    = help: try
109            x.as_ref().cloned()
110
111 error: aborting due to previous error(s)
112
113 error: Could not compile `clippy_tests`.
114
115 To learn more, run the command again with --verbose.