Add missing tests
This commit is contained in:
parent
51585a1298
commit
461f4a3466
@ -99,6 +99,16 @@ fn index(&self, _: usize) -> &i32 {
|
||||
dst[i] = src[i - from];
|
||||
}
|
||||
|
||||
#[allow(clippy::identity_op)]
|
||||
for i in 0..5 {
|
||||
dst[i - 0] = src[i];
|
||||
}
|
||||
|
||||
#[allow(clippy::reverse_range_loop)]
|
||||
for i in 0..0 {
|
||||
dst[i] = src[i];
|
||||
}
|
||||
|
||||
// `RangeTo` `for` loop - don't trigger lint
|
||||
for i in 0.. {
|
||||
dst[i] = src[i];
|
||||
|
@ -67,10 +67,22 @@ LL | for i in from..from + 3 {
|
||||
| ^^^^^^^^^^^^^^ help: try replacing the loop by: `dst[from..from + 3].clone_from_slice(&src[..(from + 3 - from)])`
|
||||
|
||||
error: it looks like you're manually copying between slices
|
||||
--> $DIR/manual_memcpy.rs:110:14
|
||||
--> $DIR/manual_memcpy.rs:103:14
|
||||
|
|
||||
LL | for i in 0..5 {
|
||||
| ^^^^ help: try replacing the loop by: `dst[..5].clone_from_slice(&src[..5])`
|
||||
|
||||
error: it looks like you're manually copying between slices
|
||||
--> $DIR/manual_memcpy.rs:108:14
|
||||
|
|
||||
LL | for i in 0..0 {
|
||||
| ^^^^ help: try replacing the loop by: `dst[..0].clone_from_slice(&src[..0])`
|
||||
|
||||
error: it looks like you're manually copying between slices
|
||||
--> $DIR/manual_memcpy.rs:120:14
|
||||
|
|
||||
LL | for i in 0..src.len() {
|
||||
| ^^^^^^^^^^^^ help: try replacing the loop by: `dst[..src.len()].clone_from_slice(&src[..])`
|
||||
|
||||
error: aborting due to 11 previous errors
|
||||
error: aborting due to 13 previous errors
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user