aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2022-03-22 22:30:53 -0700
committerFuwn <[email protected]>2022-03-22 22:30:53 -0700
commit02b6d78f6042a34e3ef86ee9a5b19406ac121a14 (patch)
tree6aaffd900bf9140ed1fbc9fd1a07fb8d4dae7e9f
parentcc58e503599218693e5755b1c4f39cf41a743488 (diff)
downloadpara-02b6d78f6042a34e3ef86ee9a5b19406ac121a14.tar.xz
para-02b6d78f6042a34e3ef86ee9a5b19406ac121a14.zip
refactor(ppm): clone_from_slice instead of clone
-rw-r--r--src/ppm.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ppm.rs b/src/ppm.rs
index 07d69b8..d39d7ed 100644
--- a/src/ppm.rs
+++ b/src/ppm.rs
@@ -317,7 +317,9 @@ impl PPMParser {
self.stream.read_uint::<LittleEndian>(1).unwrap() >> 7 & 0x1 != 0
}
- fn read_line_types(line_types: &Vec<u8>) -> impl Generator<Yield = (usize, u8), Return = ()> + '_ {
+ fn read_line_types(
+ #[allow(clippy::ptr_arg)] line_types: &Vec<u8>,
+ ) -> impl Generator<Yield = (usize, u8), Return = ()> + '_ {
move || {
for index in 0..192 {
let line_type = line_types.get(index / 4).unwrap() >> ((index % 4) * 2) & 0x03;
@@ -333,7 +335,7 @@ impl PPMParser {
}
// Copy the current layer buffers to the previous ones
- self.prev_layers = self.layers.clone();
+ self.prev_layers.clone_from_slice(&self.layers);
self.prev_frame_index = index;
// Clear the current layer buffers by resetting them to zero
self.layers.fill(vec![vec![0u8; 256]; 192]);