Skip to content

Commit

Permalink
unreachable instead of panic on timer match
Browse files Browse the repository at this point in the history
  • Loading branch information
LLeny committed Dec 15, 2024
1 parent ae6ec26 commit 577a5a5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/mikey/timers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ impl Timers {
1 => TimerReg::ControlA,
2 => TimerReg::Count,
3 => TimerReg::ControlB,
_ => panic!()
_ => unreachable!()
}
)
} else {
Expand All @@ -186,7 +186,7 @@ impl Timers {
5 => TimerReg::ControlA,
6 => TimerReg::Count,
7 => TimerReg::ControlB,
_ => panic!()
_ => unreachable!()
}
)
}
Expand All @@ -205,7 +205,7 @@ impl Timers {
TimerReg::ControlA => t.control_a(),
TimerReg::Count => t.count(),
TimerReg::ControlB => t.control_b(),
_ => panic!(),
_ => unreachable!(),
},
TimerType::Audio(t) => match cmd {
TimerReg::Backup => t.backup(),
Expand Down Expand Up @@ -235,7 +235,7 @@ impl Timers {
self.update_timer_trigger_tick(index);
},
TimerReg::ControlB => t.set_control_b(v),
_ => panic!(),
_ => unreachable!(),
},
TimerType::Audio(t) => match cmd {
TimerReg::Backup => t.set_backup(v),
Expand Down

0 comments on commit 577a5a5

Please sign in to comment.