]> git.nihav.org Git - nihav.git/blobdiff - nihav-game/src/codecs/gremlinvideo.rs
game: fix or silence clippy warnings
[nihav.git] / nihav-game / src / codecs / gremlinvideo.rs
index c8059fa6995db416eaf23f86858ce1308ef6ccd9..4b53ae87a5784ea71bc51bc008a9c96a503ddd3c 100644 (file)
@@ -143,17 +143,17 @@ impl GremlinVideoDecoder {
         let mut sidx = PREAMBLE_SIZE;
         let mut didx = 0;
 
-        for i in 0..768 { dst[paloff + i] = self.pal[i]; }
+        dst[paloff..][..768].copy_from_slice(&self.pal);
         if !self.scale_v && !self.scale_h {
             for _ in 0..h {
-                for x in 0..w { dst[didx + x] = self.frame[sidx + x]; }
+                dst[didx..][..w].copy_from_slice(&self.frame[sidx..][..w]);
                 sidx += w;
                 didx += stride;
             }
         } else {
             for y in 0..h {
                 if !self.scale_v {
-                    for x in 0..w { dst[didx + x] = self.frame[sidx + x]; }
+                    dst[didx..][..w].copy_from_slice(&self.frame[sidx..][..w]);
                 } else {
                     for x in 0..w { dst[didx + x] = self.frame[sidx + x/2]; }
                 }
@@ -247,6 +247,7 @@ impl GremlinVideoDecoder {
         Ok(())
     }
 
+    #[allow(clippy::identity_op)]
     fn decode_method68(&mut self, br: &mut ByteReader,
                        skip: usize, use8: bool) -> DecoderResult<()> {
         let mut bits = Bits32::new();
@@ -460,6 +461,12 @@ impl NADecoder for GremlinVideoDecoder {
     }
 }
 
+impl NAOptionHandler for GremlinVideoDecoder {
+    fn get_supported_options(&self) -> &[NAOptionDefinition] { &[] }
+    fn set_options(&mut self, _options: &[NAOption]) { }
+    fn query_option_value(&self, _name: &str) -> Option<NAValue> { None }
+}
+
 pub fn get_decoder_video() -> Box<dyn NADecoder + Send> {
     Box::new(GremlinVideoDecoder::new())
 }
@@ -554,6 +561,12 @@ impl NADecoder for GremlinAudioDecoder {
     }
 }
 
+impl NAOptionHandler for GremlinAudioDecoder {
+    fn get_supported_options(&self) -> &[NAOptionDefinition] { &[] }
+    fn set_options(&mut self, _options: &[NAOption]) { }
+    fn query_option_value(&self, _name: &str) -> Option<NAValue> { None }
+}
+
 pub fn get_decoder_audio() -> Box<dyn NADecoder + Send> {
     Box::new(GremlinAudioDecoder::new())
 }