From 2f97fd11d431666c342865c08ae45dd9ac272e3e Mon Sep 17 00:00:00 2001 From: kosmar Date: Wed, 12 Aug 2026 18:22:55 +0200 Subject: [PATCH] chore: read USB MIDI packets with as_chunks to satisfy clippy clippy::chunks_exact_to_as_chunks fires on the constant chunk size in the USB RX loop, and CI runs clippy with -D warnings, so main does not pass its own gate on a current toolchain. Feature branches have been carrying this same one-line fix inside unrelated app commits to stay green; landing it here means they no longer have to. as_chunks::<4>() yields &[[u8; 4]], so the packet indexing below is unchanged. The discarded remainder matches the previous behaviour: chunks_exact dropped a trailing partial packet too, and a USB MIDI bulk transfer is always a multiple of four bytes. Authored by an AI coding agent on behalf of kosmar. Co-authored-by: Cursor --- faderpunk/src/tasks/midi.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/faderpunk/src/tasks/midi.rs b/faderpunk/src/tasks/midi.rs index 24cf0f11d..1b43eb5c5 100644 --- a/faderpunk/src/tasks/midi.rs +++ b/faderpunk/src/tasks/midi.rs @@ -517,7 +517,7 @@ pub async fn midi_in_task<'a>( if len == 0 { continue; } - let packets = usb_rx_buf[..len].chunks_exact(4); + let (packets, _) = usb_rx_buf[..len].as_chunks::<4>(); for packet in packets { let cable = packet[0] >> 4; let msg_len = len_from_cin(packet[0]);