File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -52,20 +52,17 @@ impl TaskChannels {
52
52
self . tx . clone ( )
53
53
}
54
54
55
- fn take_rx ( & self ) -> Option < Receiver < RTask > > {
55
+ fn take_rx ( & self ) -> Receiver < RTask > {
56
56
let mut rx = self . rx . lock ( ) . unwrap ( ) ;
57
- rx. take ( )
57
+ rx. take ( ) . expect ( "`take_rx()` can only be called once" )
58
58
}
59
59
}
60
60
61
61
/// Returns receivers for both interrupt and idle tasks.
62
62
/// Initializes the task channels if they haven't been initialized yet.
63
63
/// Can only be called once (intended for `RMain` during init).
64
64
pub ( crate ) fn take_receivers ( ) -> ( Receiver < RTask > , Receiver < RTask > ) {
65
- (
66
- INTERRUPT_TASKS . take_rx ( ) . unwrap ( ) ,
67
- IDLE_TASKS . take_rx ( ) . unwrap ( ) ,
68
- )
65
+ ( INTERRUPT_TASKS . take_rx ( ) , IDLE_TASKS . take_rx ( ) )
69
66
}
70
67
71
68
pub enum RTask {
You can’t perform that action at this time.
0 commit comments