mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-27 15:11:30 +00:00
74 lines
2 KiB
Text
74 lines
2 KiB
Text
error: unnecessary use of `copied`
|
|
--> tests/ui/unnecessary_iter_cloned.rs:33: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:48: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:179:18
|
|
|
|
|
LL | for c in v.iter().cloned() {
|
|
| ^^^^^^^^^^^^^^^^^ help: use: `v.iter()`
|
|
|
|
error: unnecessary use of `cloned`
|
|
--> tests/ui/unnecessary_iter_cloned.rs:187: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:196: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
|
|
|