From 76ea2e417f92e5709384b013b547aa1c9e08b88f Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Thu, 27 Jul 2023 18:17:35 +0200 Subject: [PATCH] fix clippy warnings --- src/demux.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/demux.rs b/src/demux.rs index 859faf5..0297c2f 100644 --- a/src/demux.rs +++ b/src/demux.rs @@ -70,7 +70,7 @@ impl<'a> DemuxerObject<'a> { } else { "" }; - if dmx_name != "" { + if !dmx_name.is_empty() { println!("trying demuxer {} on {}", dmx_name, name); if let Some(dmx_fact) = reg.dmx_reg.find_demuxer(dmx_name) { br.seek(SeekFrom::Start(0)).unwrap(); @@ -81,7 +81,7 @@ impl<'a> DemuxerObject<'a> { if ifmt.is_some() { return DemuxerObject::None; } - if dmx_name != "" { + if !dmx_name.is_empty() { println!("trying raw demuxer {} on {}", dmx_name, name); if let Some(rdmx_fact) = reg.rdmx_reg.find_demuxer(dmx_name) { br.seek(SeekFrom::Start(0)).unwrap(); @@ -129,7 +129,7 @@ impl<'a> DemuxerObject<'a> { break; } } - if pname != "" { + if !pname.is_empty() { println!("found raw stream of type {} for {}", pname, name); let pcreate = reg.pkt_reg.find_packetiser(pname).unwrap(); let mut packetiser = (pcreate)(); @@ -142,10 +142,7 @@ impl<'a> DemuxerObject<'a> { } } pub fn is_none(&self) -> bool { - match *self { - DemuxerObject::None => true, - _ => false, - } + matches!(*self, DemuxerObject::None) } pub fn get_duration(&self) -> u64 { match *self { -- 2.39.5