Skip to content

Commit d0ff8ed

Browse files
Clarify connection state variable name
1 parent 916b886 commit d0ff8ed

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/main.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,17 @@ struct Cli {
3131
}
3232

3333
static LATEST_UPDATE: LazyLock<RwLock<Option<MonitorUpdate>>> = LazyLock::new(|| RwLock::new(None));
34-
static CONNECTED: AtomicBool = AtomicBool::new(true);
34+
static MONITOR_CONNECTED: AtomicBool = AtomicBool::new(true);
3535

3636
fn monitor_notification_callback(notification: MonitorNotification) {
3737
match notification {
3838
MonitorNotification::Connected => {
3939
println!("Connected to monitor");
40-
CONNECTED.store(true, Ordering::Relaxed);
40+
MONITOR_CONNECTED.store(true, Ordering::Relaxed);
4141
}
4242
MonitorNotification::Disconnected => {
4343
println!("Disconnected from monitor");
44-
CONNECTED.store(false, Ordering::Relaxed);
44+
MONITOR_CONNECTED.store(false, Ordering::Relaxed);
4545
}
4646
MonitorNotification::Updated(update) => {
4747
// Filter out all events except player events
@@ -100,7 +100,7 @@ async fn handle_socket(mut socket: WebSocket) {
100100
let mut last_connected = true;
101101
loop {
102102
let latest_update = LATEST_UPDATE.read().unwrap().clone();
103-
let currently_connected = CONNECTED.load(Ordering::Relaxed);
103+
let currently_connected = MONITOR_CONNECTED.load(Ordering::Relaxed);
104104
let msg = {
105105
if last_connected && !currently_connected {
106106
last_connected = false;

0 commit comments

Comments
 (0)