Browse Source

Fix variable pattern matching

Kevin Lee 2 years ago
parent
commit
fd3fc7362d
1 changed files with 2 additions and 2 deletions
  1. 2 2
      Nixie_Firmware_Rust/src/ds3231.rs

+ 2 - 2
Nixie_Firmware_Rust/src/ds3231.rs

@@ -137,13 +137,13 @@ pub fn in_dst(weekday: Weekday, day: u32, month: u32, hour_24: u32) -> bool {
         3 => match prev_sunday {
             ..8 => false,
             15.. => true,
-            day => hour_24 >= 2,
+            d if d == day as i32 => hour_24 >= 2,
             _ => true,
         },
         11 => match prev_sunday {
             ..=0 => true,
             8.. => false,
-            day => hour_24 < 2,
+            d if d == day as i32 => hour_24 < 2,
             _ => false,
         },
     }