@@ -324,13 +324,13 @@ impl<B: UsbBus> UsbDevice<'_, B> {
324324 0x0000
325325 } ;
326326
327- xfer. accept_with ( & status. to_le_bytes ( ) ) . ok ( ) ;
327+ let _ = xfer. accept_with ( & status. to_le_bytes ( ) ) ;
328328 }
329329
330330 ( Recipient :: Interface , Request :: GET_STATUS ) => {
331331 let status: u16 = 0x0000 ;
332332
333- xfer. accept_with ( & status. to_le_bytes ( ) ) . ok ( ) ;
333+ let _ = xfer. accept_with ( & status. to_le_bytes ( ) ) ;
334334 }
335335
336336 ( Recipient :: Endpoint , Request :: GET_STATUS ) => {
@@ -342,7 +342,7 @@ impl<B: UsbBus> UsbDevice<'_, B> {
342342 0x0000
343343 } ;
344344
345- xfer. accept_with ( & status. to_le_bytes ( ) ) . ok ( ) ;
345+ let _ = xfer. accept_with ( & status. to_le_bytes ( ) ) ;
346346 }
347347
348348 ( Recipient :: Device , Request :: GET_DESCRIPTOR ) => {
@@ -355,13 +355,13 @@ impl<B: UsbBus> UsbDevice<'_, B> {
355355 _ => CONFIGURATION_NONE ,
356356 } ;
357357
358- xfer. accept_with ( & config. to_le_bytes ( ) ) . ok ( ) ;
358+ let _ = xfer. accept_with ( & config. to_le_bytes ( ) ) ;
359359 }
360360
361361 ( Recipient :: Interface , Request :: GET_INTERFACE ) => {
362362 // Reject interface numbers bigger than 255
363363 if req. index > core:: u8:: MAX . into ( ) {
364- xfer. reject ( ) . ok ( ) ;
364+ let _ = xfer. reject ( ) ;
365365 return ;
366366 }
367367
@@ -370,22 +370,21 @@ impl<B: UsbBus> UsbDevice<'_, B> {
370370 for cls in classes {
371371 if let Some ( setting) = cls. get_alt_setting ( InterfaceNumber ( req. index as u8 ) )
372372 {
373- xfer. accept_with ( & setting. to_le_bytes ( ) ) . ok ( ) ;
373+ let _ = xfer. accept_with ( & setting. to_le_bytes ( ) ) ;
374374 return ;
375375 }
376376 }
377377
378378 // 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 ( ) ) ;
381380 }
382381
383382 _ => ( ) ,
384383 } ;
385384 }
386385
387386 if self . control . waiting_for_response ( ) {
388- self . control . reject ( ) . ok ( ) ;
387+ let _ = self . control . reject ( ) ;
389388 }
390389 }
391390
@@ -414,13 +413,13 @@ impl<B: UsbBus> UsbDevice<'_, B> {
414413 Request :: FEATURE_DEVICE_REMOTE_WAKEUP ,
415414 ) => {
416415 self . remote_wakeup_enabled = false ;
417- xfer. accept ( ) . ok ( ) ;
416+ let _ = xfer. accept ( ) ;
418417 }
419418
420419 ( Recipient :: Endpoint , Request :: CLEAR_FEATURE , Request :: FEATURE_ENDPOINT_HALT ) => {
421420 self . bus
422421 . set_stalled ( ( ( req. index as u8 ) & 0x8f ) . into ( ) , false ) ;
423- xfer. accept ( ) . ok ( ) ;
422+ let _ = xfer. accept ( ) ;
424423 }
425424
426425 (
@@ -429,13 +428,13 @@ impl<B: UsbBus> UsbDevice<'_, B> {
429428 Request :: FEATURE_DEVICE_REMOTE_WAKEUP ,
430429 ) => {
431430 self . remote_wakeup_enabled = true ;
432- xfer. accept ( ) . ok ( ) ;
431+ let _ = xfer. accept ( ) ;
433432 }
434433
435434 ( Recipient :: Endpoint , Request :: SET_FEATURE , Request :: FEATURE_ENDPOINT_HALT ) => {
436435 self . bus
437436 . set_stalled ( ( ( req. index as u8 ) & 0x8f ) . into ( ) , true ) ;
438- xfer. accept ( ) . ok ( ) ;
437+ let _ = xfer. accept ( ) ;
439438 }
440439
441440 ( Recipient :: Device , Request :: SET_ADDRESS , 1 ..=127 ) => {
@@ -445,59 +444,59 @@ impl<B: UsbBus> UsbDevice<'_, B> {
445444 } else {
446445 self . pending_address = req. value as u8 ;
447446 }
448- xfer. accept ( ) . ok ( ) ;
447+ let _ = xfer. accept ( ) ;
449448 }
450449
451450 ( Recipient :: Device , Request :: SET_CONFIGURATION , CONFIGURATION_VALUE_U16 ) => {
452451 self . device_state = UsbDeviceState :: Configured ;
453- xfer. accept ( ) . ok ( ) ;
452+ let _ = xfer. accept ( ) ;
454453 }
455454
456455 ( Recipient :: Device , Request :: SET_CONFIGURATION , CONFIGURATION_NONE_U16 ) => {
457456 match self . device_state {
458457 UsbDeviceState :: Default => {
459- xfer. reject ( ) . ok ( ) ;
458+ let _ = xfer. accept ( ) ;
460459 }
461460 _ => {
462461 self . device_state = UsbDeviceState :: Addressed ;
463- xfer. accept ( ) . ok ( ) ;
462+ let _ = xfer. accept ( ) ;
464463 }
465464 }
466465 }
467466
468467 ( Recipient :: Interface , Request :: SET_INTERFACE , alt_setting) => {
469468 // Reject interface numbers and alt settings bigger than 255
470469 if req. index > core:: u8:: MAX . into ( ) || alt_setting > core:: u8:: MAX . into ( ) {
471- xfer. reject ( ) . ok ( ) ;
470+ let _ = xfer. reject ( ) ;
472471 return ;
473472 }
474473
475474 // Ask class implementations, whether they accept the alternate interface setting.
476475 for cls in classes {
477476 if cls. set_alt_setting ( InterfaceNumber ( req. index as u8 ) , alt_setting as u8 )
478477 {
479- xfer. accept ( ) . ok ( ) ;
478+ let _ = xfer. accept ( ) ;
480479 return ;
481480 }
482481 }
483482
484483 // Default behaviour, if no class implementation accepted the alternate setting.
485484 if alt_setting == DEFAULT_ALTERNATE_SETTING_U16 {
486- xfer. accept ( ) . ok ( ) ;
485+ let _ = xfer. accept ( ) ;
487486 } else {
488- xfer. reject ( ) . ok ( ) ;
487+ let _ = xfer. reject ( ) ;
489488 }
490489 }
491490
492491 _ => {
493- xfer. reject ( ) . ok ( ) ;
492+ let _ = xfer. reject ( ) ;
494493 return ;
495494 }
496495 }
497496 }
498497
499498 if self . control . waiting_for_response ( ) {
500- self . control . reject ( ) . ok ( ) ;
499+ let _ = self . control . reject ( ) ;
501500 }
502501 }
503502
@@ -510,12 +509,11 @@ impl<B: UsbBus> UsbDevice<'_, B> {
510509 xfer : ControlIn < B > ,
511510 f : impl FnOnce ( & mut DescriptorWriter ) -> Result < ( ) > ,
512511 ) {
513- xfer. accept ( |buf| {
512+ let _ = xfer. accept ( |buf| {
514513 let mut writer = DescriptorWriter :: new ( buf) ;
515514 f ( & mut writer) ?;
516515 Ok ( writer. position ( ) )
517- } )
518- . ok ( ) ;
516+ } ) ;
519517 }
520518
521519 match dtype {
@@ -642,13 +640,13 @@ impl<B: UsbBus> UsbDevice<'_, B> {
642640 if let Some ( s) = s {
643641 accept_writer ( xfer, |w| w. string ( s) ) ;
644642 } else {
645- xfer. reject ( ) . ok ( ) ;
643+ let _ = xfer. reject ( ) ;
646644 }
647645 }
648646 } ,
649647
650648 _ => {
651- xfer. reject ( ) . ok ( ) ;
649+ let _ = xfer. reject ( ) ;
652650 }
653651 }
654652 }
0 commit comments