aboutsummaryrefslogtreecommitdiffstats
path: root/nihav-qt
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2022-09-22 17:53:58 +0200
committerKostya Shishkov <kostya.shishkov@gmail.com>2022-09-22 17:53:58 +0200
commit6f2630992fe340ad1a122ec10c649f756e478185 (patch)
treec8c95d46546cd71e2cd5e15faef02ca9acd2b70b /nihav-qt
parentf44bddc9b5520507c7571b89763de668238d790a (diff)
downloadnihav-6f2630992fe340ad1a122ec10c649f756e478185.tar.gz
fix some clippy warnings
Diffstat (limited to 'nihav-qt')
-rw-r--r--nihav-qt/src/codecs/alac.rs2
-rw-r--r--nihav-qt/src/codecs/qdm2fft.rs6
-rw-r--r--nihav-qt/src/codecs/qdmc.rs2
-rw-r--r--nihav-qt/src/codecs/svq3.rs4
4 files changed, 7 insertions, 7 deletions
diff --git a/nihav-qt/src/codecs/alac.rs b/nihav-qt/src/codecs/alac.rs
index a4f959d..6443917 100644
--- a/nihav-qt/src/codecs/alac.rs
+++ b/nihav-qt/src/codecs/alac.rs
@@ -289,7 +289,7 @@ impl NADecoder for ALACDecoder {
let version = br.read_byte()?;
validate!(version == 0);
let bits = br.read_byte()?;
- validate!(bits >= 8 && bits <= 32);
+ validate!((8..=32).contains(&bits));
self.pb = br.read_byte()?;
validate!(self.pb == 40);
self.mb = br.read_byte()?;
diff --git a/nihav-qt/src/codecs/qdm2fft.rs b/nihav-qt/src/codecs/qdm2fft.rs
index 22ca5dc..2e6082c 100644
--- a/nihav-qt/src/codecs/qdm2fft.rs
+++ b/nihav-qt/src/codecs/qdm2fft.rs
@@ -263,7 +263,7 @@ impl QDM2FFT {
br.read(2) as u8
} else { 0 };
- let mut amp = br.read_code(&level_cb)? as i8;
+ let mut amp = br.read_code(level_cb)? as i8;
amp += self.fft_levels[LEVEL_INDEX[pos] as usize] as i8;
if amp < 0 {
amp = 0;
@@ -300,7 +300,7 @@ impl QDM2FFT {
match id {
17..=23 => {
let grp = i16::from(self.subsampling) + 4 - i16::from(id - 17);
- if grp >= 0 && grp < 5 {
+ if (0..5).contains(&grp) {
self.read_tones(br, grp as usize, false)?;
}
},
@@ -311,7 +311,7 @@ impl QDM2FFT {
},
33..=39 => {
let grp = i16::from(self.subsampling) + 4 - i16::from(id - 33);
- if grp >= 0 && grp < 5 {
+ if (0..5).contains(&grp) {
self.read_tones(br, grp as usize, true)?;
}
},
diff --git a/nihav-qt/src/codecs/qdmc.rs b/nihav-qt/src/codecs/qdmc.rs
index 27ef4e6..e80e098 100644
--- a/nihav-qt/src/codecs/qdmc.rs
+++ b/nihav-qt/src/codecs/qdmc.rs
@@ -352,7 +352,7 @@ impl NADecoder for QdmcDecoder {
let mut chunks = self.fft_buf[ch].chunks_mut(1 << self.frame_bits);
let first = chunks.next().unwrap();
let second = chunks.next().unwrap();
- first.copy_from_slice(&second);
+ first.copy_from_slice(second);
for el in second.iter_mut() {
*el = FFTC_ZERO;
}
diff --git a/nihav-qt/src/codecs/svq3.rs b/nihav-qt/src/codecs/svq3.rs
index 07331c6..a455ed5 100644
--- a/nihav-qt/src/codecs/svq3.rs
+++ b/nihav-qt/src/codecs/svq3.rs
@@ -602,7 +602,7 @@ println!("slice offset {}", _offset);
if !is_4x4 || (hdr.dquant && hdr.ftype != FrameType::I && cbp != 0) {
let dq = br.read_code_signed(IntCodeType::Gamma)?;
let new_q = i32::from(sstate.q) + dq;
- validate!(new_q >= 0 && new_q < 32);
+ validate!((0..32).contains(&new_q));
sstate.q = new_q as u8;
}
if !is_4x4 {
@@ -857,7 +857,7 @@ println!("slice offset {}", _offset);
if hdr.dquant && cbp != 0 {
let dq = br.read_code_signed(IntCodeType::Gamma)?;
let new_q = i32::from(sstate.q) + dq;
- validate!(new_q >= 0 && new_q < 32);
+ validate!((0..32).contains(&new_q));
sstate.q = new_q as u8;
}
for sb in 0..4 {