fix clippy warnings
[nihav.git] / nihav-duck / src / codecs / vpcommon.rs
index 8474dc6a211561ecf347535a80352bbd3e736bc9..eb84f4ef19582f295d679460e314882730f48cdf 100644 (file)
@@ -17,9 +17,10 @@ pub const VP_YUVA420_FORMAT: NAPixelFormaton = NAPixelFormaton{
         palette:    false
     };
 
-#[derive(Clone,Copy,Debug,PartialEq)]
+#[derive(Clone,Copy,Debug,PartialEq,Default)]
 #[allow(dead_code)]
 pub enum VPMBType {
+    #[default]
     Intra,
     InterNoMV,
     InterMV,
@@ -51,10 +52,6 @@ impl VPMBType {
     }
 }
 
-impl Default for VPMBType {
-    fn default() -> Self { VPMBType::Intra }
-}
-
 #[derive(Default)]
 pub struct VPShuffler {
     lastframe: Option<NAVideoBufferRef<u8>>,
@@ -71,18 +68,10 @@ impl VPShuffler {
         self.goldframe = Some(buf);
     }
     pub fn get_last(&mut self) -> Option<NAVideoBufferRef<u8>> {
-        if let Some(ref frm) = self.lastframe {
-            Some(frm.clone())
-        } else {
-            None
-        }
+        self.lastframe.as_ref().cloned()
     }
     pub fn get_golden(&mut self) -> Option<NAVideoBufferRef<u8>> {
-        if let Some(ref frm) = self.goldframe {
-            Some(frm.clone())
-        } else {
-            None
-        }
+        self.goldframe.as_ref().cloned()
     }
     pub fn has_refs(&self) -> bool {
         self.lastframe.is_some()