@@ -42,8 +42,7 @@ impl<System: Port> CfgInterruptLineBuilder<System> {
42
42
43
43
/// [**Required**] Specify the interrupt line to confiigure.
44
44
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 ( ) {
47
46
panic ! ( "`line` is specified twice" ) ;
48
47
}
49
48
Self {
@@ -54,8 +53,7 @@ impl<System: Port> CfgInterruptLineBuilder<System> {
54
53
55
54
/// Specify the initial priority.
56
55
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 ( ) {
59
57
panic ! ( "`priority` is specified twice" ) ;
60
58
}
61
59
Self {
@@ -98,8 +96,7 @@ impl<System: Port> CfgInterruptLineBuilder<System> {
98
96
let cfg_interrupt_line = inner. interrupt_lines . get_mut ( i) ;
99
97
100
98
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 ( ) {
103
100
panic ! ( "`priority` is already specified for this interrupt line" ) ;
104
101
}
105
102
cfg_interrupt_line. priority = Some ( priority) ;
@@ -140,8 +137,7 @@ impl CfgBuilderInterruptLine {
140
137
priority : if let Some ( i) = self . priority { i } else { 0 } ,
141
138
flags : {
142
139
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 ( ) {
145
141
f |= interrupt:: InterruptLineInitFlags :: SET_PRIORITY . bits ( ) ;
146
142
}
147
143
if self . enabled {
@@ -201,8 +197,7 @@ impl<System: Port> CfgInterruptHandlerBuilder<System> {
201
197
/// [**Required**] Specify the interrupt line to attach the interrupt
202
198
/// handler to.
203
199
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 ( ) {
206
201
panic ! ( "`line` is specified twice" ) ;
207
202
}
208
203
Self {
@@ -302,14 +297,11 @@ pub(super) const fn panic_if_unmanaged_safety_is_violated<System: Port>(
302
297
continue ;
303
298
}
304
299
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 ( ) ;
311
303
312
- if line_unmanaged {
304
+ if is_line_unmanaged {
313
305
panic ! (
314
306
"An interrupt handler that is not marked with `unmanaged` \
315
307
is attached to an interrupt line whose priority value is \
@@ -578,10 +570,9 @@ pub const unsafe fn new_interrupt_handler_table<
578
570
// Return the combined handler
579
571
let handler = T :: COMBINED_HANDLERS [ i] ;
580
572
581
- // FIXME: Work-around for `Option::is_none` not being `const fn`
582
573
// FIXME: Work-around for `Option::unwrap` not being `const fn`
583
574
// FIXME: Work-around for `assert!` not being allowed in `const fn`
584
- if let None = handler {
575
+ if handler. is_none ( ) {
585
576
panic!( "assertion failed: T::COMBINED_HANDLERS[i] should be Some but got None" ) ;
586
577
}
587
578
0 commit comments