Fix warnings: Use Vec.extend_from_slice instead of Vec.push_all

This commit is contained in:
Tetsuharu OHZEKI 2015-12-10 15:58:12 -05:00
parent b756375637
commit e8c12c1c6d
17 changed files with 23 additions and 30 deletions

View file

@ -49,7 +49,7 @@ impl<'a> CanvasPaintTask<'a> {
//copy the data to the destination vector
for _ in 0..src_read_rect.size.height {
let row = &src_data[src .. src + (4 * src_read_rect.size.width) as usize];
image_data.push_all(row);
image_data.extend_from_slice(row);
src += stride as usize;
}
@ -707,7 +707,7 @@ fn crop_image(image_data: Vec<u8>,
let mut src = (crop_rect.origin.y * stride + crop_rect.origin.x * 4) as usize;
for _ in 0..crop_rect.size.height {
let row = &image_data[src .. src + (4 * crop_rect.size.width) as usize];
new_image_data.push_all(row);
new_image_data.extend_from_slice(row);
src += stride as usize;
}
new_image_data

View file

@ -5,7 +5,6 @@
#![feature(core)]
#![feature(nonzero)]
#![feature(slice_bytes)]
#![feature(vec_push_all)]
#![feature(plugin)]
#![plugin(plugins)]