mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-30 16:39:26 +00:00
74 lines
2 KiB
Text
74 lines
2 KiB
Text
error: unnecessary use of `copied`
|
|
--> tests/ui/unnecessary_iter_cloned.rs:31:22
|
|
|
|
|
LL | for (t, path) in files.iter().copied() {
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: `-D clippy::unnecessary-to-owned` implied by `-D warnings`
|
|
= help: to override `-D warnings` add `#[allow(clippy::unnecessary_to_owned)]`
|
|
help: use
|
|
|
|
|
LL | for (t, path) in files {
|
|
| ~~~~~
|
|
help: remove any references to the binding
|
|
|
|
|
LL - let other = match get_file_path(&t) {
|
|
LL + let other = match get_file_path(t) {
|
|
|
|
|
|
|
error: unnecessary use of `copied`
|
|
--> tests/ui/unnecessary_iter_cloned.rs:46:22
|
|
|
|
|
LL | for (t, path) in files.iter().copied() {
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: use
|
|
|
|
|
LL | for (t, path) in files.iter() {
|
|
| ~~~~~~~~~~~~
|
|
help: remove any references to the binding
|
|
|
|
|
LL - let other = match get_file_path(&t) {
|
|
LL + let other = match get_file_path(t) {
|
|
|
|
|
|
|
error: unnecessary use of `cloned`
|
|
--> tests/ui/unnecessary_iter_cloned.rs:177:18
|
|
|
|
|
LL | for c in v.iter().cloned() {
|
|
| ^^^^^^^^^^^^^^^^^ help: use: `v.iter()`
|
|
|
|
error: unnecessary use of `cloned`
|
|
--> tests/ui/unnecessary_iter_cloned.rs:185:18
|
|
|
|
|
LL | for c in v.iter().cloned() {
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: use
|
|
|
|
|
LL | for c in v.iter() {
|
|
| ~~~~~~~~
|
|
help: remove any references to the binding
|
|
|
|
|
LL - let ref_c = &c;
|
|
LL + let ref_c = c;
|
|
|
|
|
|
|
error: unnecessary use of `cloned`
|
|
--> tests/ui/unnecessary_iter_cloned.rs:194:23
|
|
|
|
|
LL | for (i, c) in v.iter().cloned() {
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: use
|
|
|
|
|
LL | for (i, c) in v.iter() {
|
|
| ~~~~~~~~
|
|
help: remove any references to the binding
|
|
|
|
|
LL ~ let ref_c = c;
|
|
LL ~ let ref_i = i;
|
|
|
|
|
|
|
error: aborting due to 5 previous errors
|
|
|