@@ -321,13 +321,13 @@ impl<B: UsbBus> UsbDevice<'_, B> {
321321 0x0000
322322 } ;
323323
324- xfer. accept_with ( & status. to_le_bytes ( ) ) . ok ( ) ;
324+ let _ = xfer. accept_with ( & status. to_le_bytes ( ) ) ;
325325 }
326326
327327 ( Recipient :: Interface , Request :: GET_STATUS ) => {
328328 let status: u16 = 0x0000 ;
329329
330- xfer. accept_with ( & status. to_le_bytes ( ) ) . ok ( ) ;
330+ let _ = xfer. accept_with ( & status. to_le_bytes ( ) ) ;
331331 }
332332
333333 ( Recipient :: Endpoint , Request :: GET_STATUS ) => {
@@ -339,7 +339,7 @@ impl<B: UsbBus> UsbDevice<'_, B> {
339339 0x0000
340340 } ;
341341
342- xfer. accept_with ( & status. to_le_bytes ( ) ) . ok ( ) ;
342+ let _ = xfer. accept_with ( & status. to_le_bytes ( ) ) ;
343343 }
344344
345345 ( Recipient :: Device , Request :: GET_DESCRIPTOR ) => {
@@ -352,13 +352,13 @@ impl<B: UsbBus> UsbDevice<'_, B> {
352352 _ => CONFIGURATION_NONE ,
353353 } ;
354354
355- xfer. accept_with ( & config. to_le_bytes ( ) ) . ok ( ) ;
355+ let _ = xfer. accept_with ( & config. to_le_bytes ( ) ) ;
356356 }
357357
358358 ( Recipient :: Interface , Request :: GET_INTERFACE ) => {
359359 // Reject interface numbers bigger than 255
360360 if req. index > core:: u8:: MAX . into ( ) {
361- xfer. reject ( ) . ok ( ) ;
361+ let _ = xfer. reject ( ) ;
362362 return ;
363363 }
364364
@@ -367,22 +367,21 @@ impl<B: UsbBus> UsbDevice<'_, B> {
367367 for cls in classes {
368368 if let Some ( setting) = cls. get_alt_setting ( InterfaceNumber ( req. index as u8 ) )
369369 {
370- xfer. accept_with ( & setting. to_le_bytes ( ) ) . ok ( ) ;
370+ let _ = xfer. accept_with ( & setting. to_le_bytes ( ) ) ;
371371 return ;
372372 }
373373 }
374374
375375 // If no class returned an alternate setting, return the default value
376- xfer. accept_with ( & DEFAULT_ALTERNATE_SETTING . to_le_bytes ( ) )
377- . ok ( ) ;
376+ let _ = xfer. accept_with ( & DEFAULT_ALTERNATE_SETTING . to_le_bytes ( ) ) ;
378377 }
379378
380379 _ => ( ) ,
381380 } ;
382381 }
383382
384383 if self . control . waiting_for_response ( ) {
385- self . control . reject ( ) . ok ( ) ;
384+ let _ = self . control . reject ( ) ;
386385 }
387386 }
388387
@@ -411,13 +410,13 @@ impl<B: UsbBus> UsbDevice<'_, B> {
411410 Request :: FEATURE_DEVICE_REMOTE_WAKEUP ,
412411 ) => {
413412 self . remote_wakeup_enabled = false ;
414- xfer. accept ( ) . ok ( ) ;
413+ let _ = xfer. accept ( ) ;
415414 }
416415
417416 ( Recipient :: Endpoint , Request :: CLEAR_FEATURE , Request :: FEATURE_ENDPOINT_HALT ) => {
418417 self . bus
419418 . set_stalled ( ( ( req. index as u8 ) & 0x8f ) . into ( ) , false ) ;
420- xfer. accept ( ) . ok ( ) ;
419+ let _ = xfer. accept ( ) ;
421420 }
422421
423422 (
@@ -426,13 +425,13 @@ impl<B: UsbBus> UsbDevice<'_, B> {
426425 Request :: FEATURE_DEVICE_REMOTE_WAKEUP ,
427426 ) => {
428427 self . remote_wakeup_enabled = true ;
429- xfer. accept ( ) . ok ( ) ;
428+ let _ = xfer. accept ( ) ;
430429 }
431430
432431 ( Recipient :: Endpoint , Request :: SET_FEATURE , Request :: FEATURE_ENDPOINT_HALT ) => {
433432 self . bus
434433 . set_stalled ( ( ( req. index as u8 ) & 0x8f ) . into ( ) , true ) ;
435- xfer. accept ( ) . ok ( ) ;
434+ let _ = xfer. accept ( ) ;
436435 }
437436
438437 ( Recipient :: Device , Request :: SET_ADDRESS , 1 ..=127 ) => {
@@ -442,59 +441,59 @@ impl<B: UsbBus> UsbDevice<'_, B> {
442441 } else {
443442 self . pending_address = req. value as u8 ;
444443 }
445- xfer. accept ( ) . ok ( ) ;
444+ let _ = xfer. accept ( ) ;
446445 }
447446
448447 ( Recipient :: Device , Request :: SET_CONFIGURATION , CONFIGURATION_VALUE_U16 ) => {
449448 self . device_state = UsbDeviceState :: Configured ;
450- xfer. accept ( ) . ok ( ) ;
449+ let _ = xfer. accept ( ) ;
451450 }
452451
453452 ( Recipient :: Device , Request :: SET_CONFIGURATION , CONFIGURATION_NONE_U16 ) => {
454453 match self . device_state {
455454 UsbDeviceState :: Default => {
456- xfer. reject ( ) . ok ( ) ;
455+ let _ = xfer. accept ( ) ;
457456 }
458457 _ => {
459458 self . device_state = UsbDeviceState :: Addressed ;
460- xfer. accept ( ) . ok ( ) ;
459+ let _ = xfer. accept ( ) ;
461460 }
462461 }
463462 }
464463
465464 ( Recipient :: Interface , Request :: SET_INTERFACE , alt_setting) => {
466465 // Reject interface numbers and alt settings bigger than 255
467466 if req. index > core:: u8:: MAX . into ( ) || alt_setting > core:: u8:: MAX . into ( ) {
468- xfer. reject ( ) . ok ( ) ;
467+ let _ = xfer. reject ( ) ;
469468 return ;
470469 }
471470
472471 // Ask class implementations, whether they accept the alternate interface setting.
473472 for cls in classes {
474473 if cls. set_alt_setting ( InterfaceNumber ( req. index as u8 ) , alt_setting as u8 )
475474 {
476- xfer. accept ( ) . ok ( ) ;
475+ let _ = xfer. accept ( ) ;
477476 return ;
478477 }
479478 }
480479
481480 // Default behaviour, if no class implementation accepted the alternate setting.
482481 if alt_setting == DEFAULT_ALTERNATE_SETTING_U16 {
483- xfer. accept ( ) . ok ( ) ;
482+ let _ = xfer. accept ( ) ;
484483 } else {
485- xfer. reject ( ) . ok ( ) ;
484+ let _ = xfer. reject ( ) ;
486485 }
487486 }
488487
489488 _ => {
490- xfer. reject ( ) . ok ( ) ;
489+ let _ = xfer. reject ( ) ;
491490 return ;
492491 }
493492 }
494493 }
495494
496495 if self . control . waiting_for_response ( ) {
497- self . control . reject ( ) . ok ( ) ;
496+ let _ = self . control . reject ( ) ;
498497 }
499498 }
500499
@@ -507,12 +506,11 @@ impl<B: UsbBus> UsbDevice<'_, B> {
507506 xfer : ControlIn < B > ,
508507 f : impl FnOnce ( & mut DescriptorWriter ) -> Result < ( ) > ,
509508 ) {
510- xfer. accept ( |buf| {
509+ let _ = xfer. accept ( |buf| {
511510 let mut writer = DescriptorWriter :: new ( buf) ;
512511 f ( & mut writer) ?;
513512 Ok ( writer. position ( ) )
514- } )
515- . ok ( ) ;
513+ } ) ;
516514 }
517515
518516 match dtype {
@@ -595,6 +593,7 @@ impl<B: UsbBus> UsbDevice<'_, B> {
595593 2 => lang. product ,
596594 3 => lang. serial ,
597595 _ => unreachable ! ( ) ,
596+
598597 }
599598 }
600599 _ => {
@@ -608,13 +607,13 @@ impl<B: UsbBus> UsbDevice<'_, B> {
608607 if let Some ( string_descriptor) = string {
609608 accept_writer ( xfer, |w| w. string ( string_descriptor) ) ;
610609 } else {
611- xfer. reject ( ) . ok ( ) ;
610+ let _ = xfer. reject ( ) ;
612611 }
613612 }
614613 } ,
615614
616615 _ => {
617- xfer. reject ( ) . ok ( ) ;
616+ let _ = xfer. reject ( ) ;
618617 }
619618 }
620619 }
0 commit comments