diff options
author | Kostya Shishkov <kostya.shishkov@gmail.com> | 2022-09-22 17:53:58 +0200 |
---|---|---|
committer | Kostya Shishkov <kostya.shishkov@gmail.com> | 2022-09-22 17:53:58 +0200 |
commit | 6f2630992fe340ad1a122ec10c649f756e478185 (patch) | |
tree | c8c95d46546cd71e2cd5e15faef02ca9acd2b70b /nihav-llaudio | |
parent | f44bddc9b5520507c7571b89763de668238d790a (diff) | |
download | nihav-6f2630992fe340ad1a122ec10c649f756e478185.tar.gz |
fix some clippy warnings
Diffstat (limited to 'nihav-llaudio')
-rw-r--r-- | nihav-llaudio/src/codecs/flacenc.rs | 6 | ||||
-rw-r--r-- | nihav-llaudio/src/demuxers/ape.rs | 2 | ||||
-rw-r--r-- | nihav-llaudio/src/demuxers/flacraw.rs | 6 |
3 files changed, 5 insertions, 9 deletions
diff --git a/nihav-llaudio/src/codecs/flacenc.rs b/nihav-llaudio/src/codecs/flacenc.rs index 55c7eb0..8b5b44d 100644 --- a/nihav-llaudio/src/codecs/flacenc.rs +++ b/nihav-llaudio/src/codecs/flacenc.rs @@ -396,9 +396,9 @@ impl NAEncoder for FLACEncoder { fn negotiate_format(&self, encinfo: &EncodeParameters) -> EncoderResult<EncodeParameters> { match encinfo.format { NACodecTypeInfo::None => { - let mut ofmt = EncodeParameters::default(); - ofmt.format = NACodecTypeInfo::Audio(NAAudioInfo::new(0, 1, SND_S16_FORMAT, DEFAULT_BLOCK_LEN)); - Ok(ofmt) + Ok(EncodeParameters { + format: NACodecTypeInfo::Audio(NAAudioInfo::new(0, 1, SND_S16_FORMAT, DEFAULT_BLOCK_LEN)), + ..Default::default() }) }, NACodecTypeInfo::Video(_) => Err(EncoderError::FormatError), NACodecTypeInfo::Audio(ainfo) => { diff --git a/nihav-llaudio/src/demuxers/ape.rs b/nihav-llaudio/src/demuxers/ape.rs index c58915b..1da6cf2 100644 --- a/nihav-llaudio/src/demuxers/ape.rs +++ b/nihav-llaudio/src/demuxers/ape.rs @@ -39,7 +39,7 @@ impl<'a> DemuxCore<'a> for APEDemuxer<'a> { let tag = src.read_tag()?; validate!(&tag == b"MAC "); let version = src.read_u16le()?; - validate!(version >= 3800 && version <= 3990); + validate!((3800..=3990).contains(&version)); let seektab_len; let _wavtail_len; diff --git a/nihav-llaudio/src/demuxers/flacraw.rs b/nihav-llaudio/src/demuxers/flacraw.rs index e8d1f4a..c04f1f0 100644 --- a/nihav-llaudio/src/demuxers/flacraw.rs +++ b/nihav-llaudio/src/demuxers/flacraw.rs @@ -137,11 +137,7 @@ impl RawDemuxerCreator for FLACDemuxerCreator { if br.seek(SeekFrom::Start(0)).is_err() { return false; } - if let Ok([b'f', b'L', b'a', b'C']) = br.read_tag() { - true - } else { - false - } + matches!(br.read_tag(), Ok([b'f', b'L', b'a', b'C'])) } } |