From 21fcb661f1b8aed1ccfb103b2de3bf49f2c4e406 Mon Sep 17 00:00:00 2001 From: doryan Date: Tue, 27 May 2025 21:47:53 +0400 Subject: [PATCH] fix: use .skip() instead slicing [1..] --- src/lib.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 257a02c..75462a6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -38,9 +38,11 @@ impl UsbBus for UsbDevice { // If ep_aadr not provided, or current endpoint is allocated, try to find next free endpoint, otherwise return UsbError. // _ => { - let index = self.ep_table[1..] + let index = self + .ep_table .iter() .enumerate() + .skip(1) .find(|(index, ep)| { !ep.is_allocated && max_packet_size <= ENDPOINTS_ALLOC_LAYOUT[*index] })