···627627 let (width, height) = self.resolution_to_size(resolution);
628628 let pixmap = self.render_to_pixmap_no_cache(width, height)?;
629629630630- let mut data = vec![0u8; height as usize * width as usize * 3];
630630+ let (width, height) = (width as usize, height as usize);
631631+ let mut data = vec![0u8; height * width * 3];
632632+631633 data.par_chunks_exact_mut(3)
632634 .enumerate()
633635 .for_each(|(index, chunk)| {
634634- let x = index / (height as usize);
635635- let y = index % (height as usize);
636636+ let x = index / height;
637637+ let y = index % height;
636638637639 let pixel = pixmap
638640 .pixel(x as u32, y as u32)
···643645 chunk[2] = pixel.blue();
644646 });
645647646646- Ok(video_rs::Frame::from_shape_vec(
647647- [height as usize, width as usize, 3],
648648- data,
649649- )?)
648648+ Ok(video_rs::Frame::from_shape_vec([height, width, 3], data)?)
650649 }
651650652651 fn usvg_tree_to_pixmap(