chore: read USB MIDI packets with as_chunks to satisfy clippy - #643
Open
kosmar wants to merge 1 commit into
Open
chore: read USB MIDI packets with as_chunks to satisfy clippy#643kosmar wants to merge 1 commit into
kosmar wants to merge 1 commit into
Conversation
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 <cursoragent@cursor.com>
ArthurGibert
approved these changes
Aug 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
clippy::chunks_exact_to_as_chunksfires on the constant chunk size in the USBRX loop of
tasks/midi.rs. CI runs clippy with-D warnings, so on a currenttoolchain
maindoes not pass its own gate — and several open feature brancheshave been carrying this exact one-line fix inside unrelated app commits just to
stay green.
as_chunks::<4>()yields&[[u8; 4]], so the packet indexing below isunchanged. Discarding the remainder matches the previous behaviour:
chunks_exactdropped a trailing partial packet as well, and a USB MIDI bulk transfer is always
a multiple of four bytes.
Verified with
cargo clippy --bin faderpunk --target thumbv8m.main-none-eabihf -- -D warnings,which is clean on this branch and fails on
main.Authored by an AI coding agent on behalf of @kosmar.
Made with Cursor