fix some clippy warnings
[nihav.git] / nihav-core / src / scale / palette / mod.rs
index f9b0ee9b033fa9ae4f99435a3731291527a93efd..f70300fb8666f810ff68e23a911d51cc15345270 100644 (file)
@@ -14,7 +14,7 @@ impl Pixel {
     fn new(src: &[u8]) -> Self {
         Self { r: src[0], g: src[1], b: src[2] }
     }
-    fn to_rgb(&self) -> [u8; 3] {
+    fn to_rgb(self) -> [u8; 3] {
         [self.r, self.g, self.b]
     }
     fn dist(&self, pix: Pixel) -> u32 {
@@ -102,7 +102,7 @@ fn palettise_frame_internal(pic_in: &NABufferType, pic_out: &mut NABufferType, q
         let ofmt = dbuf.get_info().get_format();
         let dst = dbuf.get_data_mut().unwrap();
 
-        pixels.truncate(0);
+        pixels.clear();
         if !ifmt.is_unpacked() {
             let esize = ifmt.elem_size as usize;
             let coffs = [ifmt.comp_info[0].unwrap().comp_offs as usize, ifmt.comp_info[1].unwrap().comp_offs as usize, ifmt.comp_info[2].unwrap().comp_offs as usize];