]> git.nihav.org Git - nihav-tool.git/commitdiff
fix some clippy warnings
authorKostya Shishkov <kostya.shishkov@gmail.com>
Sun, 4 Apr 2021 08:16:55 +0000 (10:16 +0200)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Sun, 4 Apr 2021 08:16:55 +0000 (10:16 +0200)
src/main.rs

index c6875fb45b232d41b33c05af97ddc0036a5d7e5a..6d29d4618052906ebf0fcd6ccb94bb3fec5a41b5 100644 (file)
@@ -40,7 +40,7 @@ impl FrameOutput {
                     NumberMode::PktPTS  => { pkt.get_pts().unwrap() },
                     NumberMode::FrmPTS  => { if let Some(pt) = frm.get_pts() { pt } else { pkt.get_pts().unwrap() } },
                 };
-            if let Err(_) = write_pnm(&self.prefix, self.streamno, pts, frm) {
+            if write_pnm(&self.prefix, self.streamno, pts, frm).is_err() {
                 println!("error writing output picture");
             }
         }
@@ -273,7 +273,7 @@ println!("stream {} - {} {}", i, s, info.get_name());
         if dump_frames {
             let name = format!("out{:02}_{:08}.frm", streamno, pkt.get_pts().unwrap_or(frmnum));
             let mut ofile = File::create(name).unwrap();
-            ofile.write(pkt.get_buffer().as_slice()).unwrap();
+            ofile.write_all(pkt.get_buffer().as_slice()).unwrap();
             frmnum += 1;
         }
         if let Some((ref mut dsupp, ref mut dec)) = decs[idx] {