chore: improve performance of match statements

This commit is contained in:
2021-05-19 02:52:32 -05:00
parent e89e89df5b
commit 9ea26d4a05
7 changed files with 99 additions and 89 deletions

View File

@@ -84,7 +84,7 @@ pub enum TimerSpeed {
impl From<u8> for TimerSpeed {
fn from(byte: u8) -> Self {
match byte {
match byte & 0b11 {
0b00 => Self::Hz4096,
0b01 => Self::Hz262144,
0b10 => Self::Hz65536,