mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-22 02:53:20 +00:00
34 lines
1.1 KiB
Text
34 lines
1.1 KiB
Text
error: used `cloned` where `copied` could be used instead
|
|
--> $DIR/cloned_instead_of_copied.rs:6:24
|
|
|
|
|
LL | let _ = [1].iter().cloned();
|
|
| ^^^^^^ help: try: `copied`
|
|
|
|
|
= note: `-D clippy::cloned-instead-of-copied` implied by `-D warnings`
|
|
|
|
error: used `cloned` where `copied` could be used instead
|
|
--> $DIR/cloned_instead_of_copied.rs:7:31
|
|
|
|
|
LL | let _ = vec!["hi"].iter().cloned();
|
|
| ^^^^^^ help: try: `copied`
|
|
|
|
error: used `cloned` where `copied` could be used instead
|
|
--> $DIR/cloned_instead_of_copied.rs:8:22
|
|
|
|
|
LL | let _ = Some(&1).cloned();
|
|
| ^^^^^^ help: try: `copied`
|
|
|
|
error: used `cloned` where `copied` could be used instead
|
|
--> $DIR/cloned_instead_of_copied.rs:9:34
|
|
|
|
|
LL | let _ = Box::new([1].iter()).cloned();
|
|
| ^^^^^^ help: try: `copied`
|
|
|
|
error: used `cloned` where `copied` could be used instead
|
|
--> $DIR/cloned_instead_of_copied.rs:10:32
|
|
|
|
|
LL | let _ = Box::new(Some(&1)).cloned();
|
|
| ^^^^^^ help: try: `copied`
|
|
|
|
error: aborting due to 5 previous errors
|
|
|