Skip to content

Commit

Permalink
Add test for manual slice clones
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusklaas committed Sep 16, 2017
1 parent e461e3f commit a6206cc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/ui/for_loop.rs
Expand Up @@ -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();
}
}

0 comments on commit a6206cc

Please sign in to comment.