From 04b90f8a5e344a5eb40a03b9262ec52657054e90 Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Sun, 4 Apr 2021 10:16:55 +0200 Subject: [PATCH] fix some clippy warnings --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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] { -- 2.39.5