@@ -42,8 +42,7 @@ impl<System: Port> CfgInterruptLineBuilder<System> {
4242
4343 /// [**Required**] Specify the interrupt line to confiigure.
4444 pub const fn line ( self , line : interrupt:: InterruptNum ) -> Self {
45- // FIXME: `Option::is_some` is not `const fn` yet
46- if let Some ( _) = self . line {
45+ if self . line . is_some ( ) {
4746 panic ! ( "`line` is specified twice" ) ;
4847 }
4948 Self {
@@ -54,8 +53,7 @@ impl<System: Port> CfgInterruptLineBuilder<System> {
5453
5554 /// Specify the initial priority.
5655 pub const fn priority ( self , priority : interrupt:: InterruptPriority ) -> Self {
57- // FIXME: `Option::is_some` is not `const fn` yet
58- if let Some ( _) = self . priority {
56+ if self . priority . is_some ( ) {
5957 panic ! ( "`priority` is specified twice" ) ;
6058 }
6159 Self {
@@ -98,8 +96,7 @@ impl<System: Port> CfgInterruptLineBuilder<System> {
9896 let cfg_interrupt_line = inner. interrupt_lines . get_mut ( i) ;
9997
10098 if let Some ( priority) = self . priority {
101- // FIXME: `Option::is_some` is not `const fn` yet
102- if let Some ( _) = cfg_interrupt_line. priority {
99+ if cfg_interrupt_line. priority . is_some ( ) {
103100 panic ! ( "`priority` is already specified for this interrupt line" ) ;
104101 }
105102 cfg_interrupt_line. priority = Some ( priority) ;
@@ -140,8 +137,7 @@ impl CfgBuilderInterruptLine {
140137 priority : if let Some ( i) = self . priority { i } else { 0 } ,
141138 flags : {
142139 let mut f = 0 ;
143- // FIXME: `Option::is_some` is not `const fn` yet
144- if let Some ( _) = self . priority {
140+ if self . priority . is_some ( ) {
145141 f |= interrupt:: InterruptLineInitFlags :: SET_PRIORITY . bits ( ) ;
146142 }
147143 if self . enabled {
@@ -201,8 +197,7 @@ impl<System: Port> CfgInterruptHandlerBuilder<System> {
201197 /// [**Required**] Specify the interrupt line to attach the interrupt
202198 /// handler to.
203199 pub const fn line ( self , line : interrupt:: InterruptNum ) -> Self {
204- // FIXME: `Option::is_some` is not `const fn` yet
205- if let Some ( _) = self . line {
200+ if self . line . is_some ( ) {
206201 panic ! ( "`line` is specified twice" ) ;
207202 }
208203 Self {
@@ -302,14 +297,11 @@ pub(super) const fn panic_if_unmanaged_safety_is_violated<System: Port>(
302297 continue ;
303298 }
304299
305- // FIXME: Work-around for `Option::is_none` not being `const fn`
306- let line_unmanaged = matches ! (
307- vec_position!( interrupt_lines, |line| line. num == handler. line
308- && line. is_initially_managed:: <System >( ) ) ,
309- None
310- ) ;
300+ let managed_line_i = vec_position ! ( interrupt_lines, |line| line. num == handler. line
301+ && line. is_initially_managed:: <System >( ) ) ;
302+ let is_line_unmanaged = managed_line_i. is_none ( ) ;
311303
312- if line_unmanaged {
304+ if is_line_unmanaged {
313305 panic ! (
314306 "An interrupt handler that is not marked with `unmanaged` \
315307 is attached to an interrupt line whose priority value is \
@@ -578,10 +570,9 @@ pub const unsafe fn new_interrupt_handler_table<
578570 // Return the combined handler
579571 let handler = T :: COMBINED_HANDLERS [ i] ;
580572
581- // FIXME: Work-around for `Option::is_none` not being `const fn`
582573 // FIXME: Work-around for `Option::unwrap` not being `const fn`
583574 // FIXME: Work-around for `assert!` not being allowed in `const fn`
584- if let None = handler {
575+ if handler. is_none ( ) {
585576 panic!( "assertion failed: T::COMBINED_HANDLERS[i] should be Some but got None" ) ;
586577 }
587578
0 commit comments