@@ -324,13 +324,13 @@ impl<B: UsbBus> UsbDevice<'_, B> {
324
324
0x0000
325
325
} ;
326
326
327
- xfer. accept_with ( & status. to_le_bytes ( ) ) . ok ( ) ;
327
+ let _ = xfer. accept_with ( & status. to_le_bytes ( ) ) ;
328
328
}
329
329
330
330
( Recipient :: Interface , Request :: GET_STATUS ) => {
331
331
let status: u16 = 0x0000 ;
332
332
333
- xfer. accept_with ( & status. to_le_bytes ( ) ) . ok ( ) ;
333
+ let _ = xfer. accept_with ( & status. to_le_bytes ( ) ) ;
334
334
}
335
335
336
336
( Recipient :: Endpoint , Request :: GET_STATUS ) => {
@@ -342,7 +342,7 @@ impl<B: UsbBus> UsbDevice<'_, B> {
342
342
0x0000
343
343
} ;
344
344
345
- xfer. accept_with ( & status. to_le_bytes ( ) ) . ok ( ) ;
345
+ let _ = xfer. accept_with ( & status. to_le_bytes ( ) ) ;
346
346
}
347
347
348
348
( Recipient :: Device , Request :: GET_DESCRIPTOR ) => {
@@ -355,13 +355,13 @@ impl<B: UsbBus> UsbDevice<'_, B> {
355
355
_ => CONFIGURATION_NONE ,
356
356
} ;
357
357
358
- xfer. accept_with ( & config. to_le_bytes ( ) ) . ok ( ) ;
358
+ let _ = xfer. accept_with ( & config. to_le_bytes ( ) ) ;
359
359
}
360
360
361
361
( Recipient :: Interface , Request :: GET_INTERFACE ) => {
362
362
// Reject interface numbers bigger than 255
363
363
if req. index > core:: u8:: MAX . into ( ) {
364
- xfer. reject ( ) . ok ( ) ;
364
+ let _ = xfer. reject ( ) ;
365
365
return ;
366
366
}
367
367
@@ -370,22 +370,21 @@ impl<B: UsbBus> UsbDevice<'_, B> {
370
370
for cls in classes {
371
371
if let Some ( setting) = cls. get_alt_setting ( InterfaceNumber ( req. index as u8 ) )
372
372
{
373
- xfer. accept_with ( & setting. to_le_bytes ( ) ) . ok ( ) ;
373
+ let _ = xfer. accept_with ( & setting. to_le_bytes ( ) ) ;
374
374
return ;
375
375
}
376
376
}
377
377
378
378
// If no class returned an alternate setting, return the default value
379
- xfer. accept_with ( & DEFAULT_ALTERNATE_SETTING . to_le_bytes ( ) )
380
- . ok ( ) ;
379
+ let _ = xfer. accept_with ( & DEFAULT_ALTERNATE_SETTING . to_le_bytes ( ) ) ;
381
380
}
382
381
383
382
_ => ( ) ,
384
383
} ;
385
384
}
386
385
387
386
if self . control . waiting_for_response ( ) {
388
- self . control . reject ( ) . ok ( ) ;
387
+ let _ = self . control . reject ( ) ;
389
388
}
390
389
}
391
390
@@ -414,13 +413,13 @@ impl<B: UsbBus> UsbDevice<'_, B> {
414
413
Request :: FEATURE_DEVICE_REMOTE_WAKEUP ,
415
414
) => {
416
415
self . remote_wakeup_enabled = false ;
417
- xfer. accept ( ) . ok ( ) ;
416
+ let _ = xfer. accept ( ) ;
418
417
}
419
418
420
419
( Recipient :: Endpoint , Request :: CLEAR_FEATURE , Request :: FEATURE_ENDPOINT_HALT ) => {
421
420
self . bus
422
421
. set_stalled ( ( ( req. index as u8 ) & 0x8f ) . into ( ) , false ) ;
423
- xfer. accept ( ) . ok ( ) ;
422
+ let _ = xfer. accept ( ) ;
424
423
}
425
424
426
425
(
@@ -429,13 +428,13 @@ impl<B: UsbBus> UsbDevice<'_, B> {
429
428
Request :: FEATURE_DEVICE_REMOTE_WAKEUP ,
430
429
) => {
431
430
self . remote_wakeup_enabled = true ;
432
- xfer. accept ( ) . ok ( ) ;
431
+ let _ = xfer. accept ( ) ;
433
432
}
434
433
435
434
( Recipient :: Endpoint , Request :: SET_FEATURE , Request :: FEATURE_ENDPOINT_HALT ) => {
436
435
self . bus
437
436
. set_stalled ( ( ( req. index as u8 ) & 0x8f ) . into ( ) , true ) ;
438
- xfer. accept ( ) . ok ( ) ;
437
+ let _ = xfer. accept ( ) ;
439
438
}
440
439
441
440
( Recipient :: Device , Request :: SET_ADDRESS , 1 ..=127 ) => {
@@ -445,59 +444,59 @@ impl<B: UsbBus> UsbDevice<'_, B> {
445
444
} else {
446
445
self . pending_address = req. value as u8 ;
447
446
}
448
- xfer. accept ( ) . ok ( ) ;
447
+ let _ = xfer. accept ( ) ;
449
448
}
450
449
451
450
( Recipient :: Device , Request :: SET_CONFIGURATION , CONFIGURATION_VALUE_U16 ) => {
452
451
self . device_state = UsbDeviceState :: Configured ;
453
- xfer. accept ( ) . ok ( ) ;
452
+ let _ = xfer. accept ( ) ;
454
453
}
455
454
456
455
( Recipient :: Device , Request :: SET_CONFIGURATION , CONFIGURATION_NONE_U16 ) => {
457
456
match self . device_state {
458
457
UsbDeviceState :: Default => {
459
- xfer. reject ( ) . ok ( ) ;
458
+ let _ = xfer. accept ( ) ;
460
459
}
461
460
_ => {
462
461
self . device_state = UsbDeviceState :: Addressed ;
463
- xfer. accept ( ) . ok ( ) ;
462
+ let _ = xfer. accept ( ) ;
464
463
}
465
464
}
466
465
}
467
466
468
467
( Recipient :: Interface , Request :: SET_INTERFACE , alt_setting) => {
469
468
// Reject interface numbers and alt settings bigger than 255
470
469
if req. index > core:: u8:: MAX . into ( ) || alt_setting > core:: u8:: MAX . into ( ) {
471
- xfer. reject ( ) . ok ( ) ;
470
+ let _ = xfer. reject ( ) ;
472
471
return ;
473
472
}
474
473
475
474
// Ask class implementations, whether they accept the alternate interface setting.
476
475
for cls in classes {
477
476
if cls. set_alt_setting ( InterfaceNumber ( req. index as u8 ) , alt_setting as u8 )
478
477
{
479
- xfer. accept ( ) . ok ( ) ;
478
+ let _ = xfer. accept ( ) ;
480
479
return ;
481
480
}
482
481
}
483
482
484
483
// Default behaviour, if no class implementation accepted the alternate setting.
485
484
if alt_setting == DEFAULT_ALTERNATE_SETTING_U16 {
486
- xfer. accept ( ) . ok ( ) ;
485
+ let _ = xfer. accept ( ) ;
487
486
} else {
488
- xfer. reject ( ) . ok ( ) ;
487
+ let _ = xfer. reject ( ) ;
489
488
}
490
489
}
491
490
492
491
_ => {
493
- xfer. reject ( ) . ok ( ) ;
492
+ let _ = xfer. reject ( ) ;
494
493
return ;
495
494
}
496
495
}
497
496
}
498
497
499
498
if self . control . waiting_for_response ( ) {
500
- self . control . reject ( ) . ok ( ) ;
499
+ let _ = self . control . reject ( ) ;
501
500
}
502
501
}
503
502
@@ -510,12 +509,11 @@ impl<B: UsbBus> UsbDevice<'_, B> {
510
509
xfer : ControlIn < B > ,
511
510
f : impl FnOnce ( & mut DescriptorWriter ) -> Result < ( ) > ,
512
511
) {
513
- xfer. accept ( |buf| {
512
+ let _ = xfer. accept ( |buf| {
514
513
let mut writer = DescriptorWriter :: new ( buf) ;
515
514
f ( & mut writer) ?;
516
515
Ok ( writer. position ( ) )
517
- } )
518
- . ok ( ) ;
516
+ } ) ;
519
517
}
520
518
521
519
match dtype {
@@ -642,13 +640,13 @@ impl<B: UsbBus> UsbDevice<'_, B> {
642
640
if let Some ( s) = s {
643
641
accept_writer ( xfer, |w| w. string ( s) ) ;
644
642
} else {
645
- xfer. reject ( ) . ok ( ) ;
643
+ let _ = xfer. reject ( ) ;
646
644
}
647
645
}
648
646
} ,
649
647
650
648
_ => {
651
- xfer. reject ( ) . ok ( ) ;
649
+ let _ = xfer. reject ( ) ;
652
650
}
653
651
}
654
652
}
0 commit comments