1 #![warn(clippy::needless_range_loop, clippy::manual_memcpy)]
3 pub fn manual_copy_with_counters(src: &[i32], dst: &mut [i32], dst2: &mut [i32]) {
5 for i in 3..src.len() {
11 for i in 3..src.len() {
17 for i in 0..src.len() {
23 for i in 0..src.len() {
29 for i in 3..(3 + src.len()) {
35 for i in 5..src.len() {
36 dst[i] = src[count - 2];
41 for i in 0..dst.len() {
54 for i in 0..src.len() {
56 dst2[count2] = src[i];
61 // make sure parentheses are added properly to bitwise operators, which have lower precedence than
63 let mut count = 0 << 1;
65 dst[count] = src[i + 2];
69 // make sure incrementing expressions without semicolons at the end of loops are handled correctly.
71 for i in 3..src.len() {
76 // make sure ones where the increment is not at the end of the loop.
77 // As a possible enhancement, one could adjust the offset in the suggestion according to
78 // the position. For example, if the increment is at the top of the loop;
79 // treating the loop counter as if it were initialized 1 greater than the original value.
81 #[allow(clippy::needless_range_loop)]
82 for i in 0..src.len() {