diff options
author | Pyfisch <pyfisch@gmail.com> | 2018-11-06 13:01:35 +0100 |
---|---|---|
committer | Pyfisch <pyfisch@gmail.com> | 2018-11-06 22:30:31 +0100 |
commit | cb07debcb6f3d3561177ce536c320986720791b7 (patch) | |
tree | ccac4d5a48b3112230f3fc2e873753dd7263e9fb /components/pixels/lib.rs | |
parent | bf47f90da667e95eaffc8fee36ca8a88e72e276c (diff) | |
download | servo-cb07debcb6f3d3561177ce536c320986720791b7.tar.gz servo-cb07debcb6f3d3561177ce536c320986720791b7.zip |
Format remaining files
Diffstat (limited to 'components/pixels/lib.rs')
-rw-r--r-- | components/pixels/lib.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/components/pixels/lib.rs b/components/pixels/lib.rs index de29e5fa2ee..806b854fda2 100644 --- a/components/pixels/lib.rs +++ b/components/pixels/lib.rs @@ -21,7 +21,10 @@ pub fn get_rect(pixels: &[u8], size: Size2D<u32>, rect: Rect<u32>) -> Cow<[u8]> return Cow::Borrowed(&pixels[start..start + area * 4]); } let mut data = Vec::with_capacity(area * 4); - for row in pixels[first_row_start..].chunks(row_length).take(rect.size.height as usize) { + for row in pixels[first_row_start..] + .chunks(row_length) + .take(rect.size.height as usize) + { data.extend_from_slice(&row[first_column_start..][..rect.size.width as usize * 4]); } data.into() |