1
0
Fork 0
mirror of https://github.com/Zedfrigg/ironbar.git synced 2025-07-04 04:01:03 +02:00

refactor: use new smart pointer macros throughout codebase

This commit is contained in:
Jake Stanger 2023-06-29 23:16:31 +01:00
parent ac04cc27ce
commit 7016f7f79e
No known key found for this signature in database
GPG key ID: C51FC8F9CB0BEA61
10 changed files with 23 additions and 25 deletions

View file

@ -1,5 +1,5 @@
use super::{Workspace, WorkspaceClient, WorkspaceUpdate};
use crate::{lock, send};
use crate::{arc_mut, lock, send};
use color_eyre::Result;
use hyprland::data::{Workspace as HWorkspace, Workspaces};
use hyprland::dispatch::{Dispatch, DispatchType, WorkspaceIdentifierWithSpecial};
@ -7,7 +7,6 @@ use hyprland::event_listener::EventListenerMutable as EventListener;
use hyprland::prelude::*;
use hyprland::shared::WorkspaceType;
use lazy_static::lazy_static;
use std::sync::{Arc, Mutex};
use tokio::sync::broadcast::{channel, Receiver, Sender};
use tokio::task::spawn_blocking;
use tracing::{debug, error, info};
@ -36,11 +35,11 @@ impl EventClient {
let mut event_listener = EventListener::new();
// we need a lock to ensure events don't run at the same time
let lock = Arc::new(Mutex::new(()));
let lock = arc_mut!(());
// cache the active workspace since Hyprland doesn't give us the prev active
let active = Self::get_active_workspace().expect("Failed to get active workspace");
let active = Arc::new(Mutex::new(Some(active)));
let active = arc_mut!(Some(active));
{
let tx = tx.clone();