diff --git a/src/bot.rs b/src/bot.rs index 7ace3c2..479284f 100644 --- a/src/bot.rs +++ b/src/bot.rs @@ -146,7 +146,12 @@ impl Bot { #[instrument(skip(self))] async fn update_open_state(&self) -> Result { let new_state = get_open_state(&self.api).await?; - if *self.open_state.lock().unwrap() != Some(new_state) { + if self + .open_state + .lock() + .unwrap() + .is_some_and(|old_state| old_state != new_state) + { let message = if let OpenState::Open { .. } = new_state { "opening IT-Syndikat - Ohai!" } else {