mirror of
https://github.com/rust-lang/rust-clippy
synced 2025-02-17 14:38:46 +00:00
Add test for manual slice clones
This commit is contained in:
parent
e461e3f915
commit
a6206cc5f8
1 changed files with 7 additions and 0 deletions
|
@ -541,3 +541,10 @@ pub fn manual_copy(src: &[i32], dst: &mut [i32], dst2: &mut [i32]) {
|
|||
dst_vec[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
#[warn(needless_range_loop)]
|
||||
pub fn manual_clone(src: &[String], dst: &mut [String]) {
|
||||
for i in 0..src.len() {
|
||||
dst[i] = src[i].clone();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue