replace vec.truncate(0) with vec.clear()
[nihav.git] / nihav-itu / src / codecs / h264 / mod.rs
index 5ecd05cc6fd875baacc8ad4ef1e19981e3a0418a..e23d909930bcc4704168027ca8c5d23c1b077268 100644 (file)
@@ -15,6 +15,10 @@ mod types;
 pub use types::*;
 mod pic_ref;
 pub use pic_ref::*;
+#[allow(clippy::identity_op)]
+#[allow(clippy::erasing_op)]
+#[allow(clippy::many_single_char_names)]
+#[allow(clippy::range_plus_one)]
 mod dsp;
 use dsp::*;
 mod cabac;
@@ -190,7 +194,7 @@ struct H264Decoder {
 fn unescape_nal(src: &[u8], dst: &mut Vec<u8>) -> usize {
     let mut off = 0;
     let mut zrun = 0;
-    dst.truncate(0);
+    dst.clear();
     dst.reserve(src.len());
     while off < src.len() {
         dst.push(src[off]);
@@ -653,6 +657,7 @@ println!("PAFF?");
             }
         }
     }
+    #[allow(clippy::cognitive_complexity)]
     fn handle_macroblock(&mut self, mb_info: &mut CurrentMBInfo) {
         let pps = &self.pps[self.cur_pps];