fix: use .skip() instead slicing [1..]
This commit is contained in:
parent
29e5edde8a
commit
21fcb661f1
|
@ -38,9 +38,11 @@ impl<const L: usize> UsbBus for UsbDevice<L> {
|
||||||
|
|
||||||
// If ep_aadr not provided, or current endpoint is allocated, try to find next free endpoint, otherwise return UsbError. //
|
// 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()
|
.iter()
|
||||||
.enumerate()
|
.enumerate()
|
||||||
|
.skip(1)
|
||||||
.find(|(index, ep)| {
|
.find(|(index, ep)| {
|
||||||
!ep.is_allocated && max_packet_size <= ENDPOINTS_ALLOC_LAYOUT[*index]
|
!ep.is_allocated && max_packet_size <= ENDPOINTS_ALLOC_LAYOUT[*index]
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue