From: Kostya Shishkov Date: Sun, 4 Apr 2021 08:16:55 +0000 (+0200) Subject: fix some clippy warnings X-Git-Url: https://git.nihav.org/?p=nihav-tool.git;a=commitdiff_plain;h=04b90f8a5e344a5eb40a03b9262ec52657054e90;ds=sidebyside fix some clippy warnings --- diff --git a/src/main.rs b/src/main.rs index c6875fb..6d29d46 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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] {