From efb4acc35a30f78a5b40a676fecc8355ef0bdd80 Mon Sep 17 00:00:00 2001 From: astar76 Date: Thu, 19 Nov 2026 07:24:54 -0600 Subject: [PATCH] player: read ffmpeg PCM with as_chunks (clippy) Co-Authored-By: Claude Opus 5.5 --- crates/tunal-player/src/ffmpeg.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/crates/tunal-player/src/ffmpeg.rs b/crates/tunal-player/src/ffmpeg.rs index 788c401..811d2d4 100644 --- a/crates/tunal-player/src/ffmpeg.rs +++ b/crates/tunal-player/src/ffmpeg.rs @@ -115,11 +115,9 @@ impl Ffmpeg { continue; } self.samples.clear(); - self.samples.extend( - self.bytes[..whole] - .chunks_exact(4) - .map(|b| f32::from_le_bytes([b[0], b[1], b[2], b[3]])), - ); + let (samples, _) = self.bytes[..whole].as_chunks::<4>(); + self.samples + .extend(samples.iter().map(|b| f32::from_le_bytes(*b))); self.bytes.copy_within(whole..total, 0); self.partial = total - whole; self.produced = true;