From f79f610d2a28ac922e9c022c72c6fe6d70cefdd9 Mon Sep 17 00:00:00 2001 From: Akshat Gupta Date: Sat, 24 Jan 2026 19:19:15 +0530 Subject: [PATCH] fix(#229): replace magic number with named constant --- nmrs/src/monitoring/bluetooth.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nmrs/src/monitoring/bluetooth.rs b/nmrs/src/monitoring/bluetooth.rs index 42f72156..61b0f21a 100644 --- a/nmrs/src/monitoring/bluetooth.rs +++ b/nmrs/src/monitoring/bluetooth.rs @@ -9,7 +9,7 @@ use zbus::Connection; use crate::dbus::{NMBluetoothProxy, NMDeviceProxy, NMProxy}; use crate::monitoring::transport::ActiveTransport; use crate::try_log; -use crate::types::constants::device_type; +use crate::types::constants::{device_state, device_type}; pub(crate) struct Bluetooth; @@ -65,7 +65,7 @@ pub(crate) async fn current_bluetooth_bdaddr(conn: &Connection) -> Option Option<(String, // Check if device is in an active/connected state let state = try_log!(dev.state().await, "Failed to get device state"); // State 100 = Activated (connected) - if state != 100 { + if state != device_state::ACTIVATED { continue; }