1
0
Fork 0
mirror of https://github.com/Zedfrigg/ironbar.git synced 2025-08-17 14:51:04 +02:00

refactor: update to rust 2024, fix strict clippy warnings

This commit is contained in:
Jake Stanger 2025-02-21 16:35:54 +00:00
parent 79c917857c
commit 202c19efd4
No known key found for this signature in database
GPG key ID: C51FC8F9CB0BEA61
57 changed files with 132 additions and 124 deletions

View file

@ -1,3 +1,4 @@
use crate::clients::ClientResult;
use crate::register_fallible_client;
use cfg_if::cfg_if;
use color_eyre::{Help, Report, Result};
@ -67,7 +68,7 @@ impl Compositor {
pub fn create_keyboard_layout_client(
clients: &mut super::Clients,
) -> Result<Arc<dyn KeyboardLayoutClient + Send + Sync>> {
) -> ClientResult<dyn KeyboardLayoutClient + Send + Sync> {
let current = Self::get_current();
debug!("Getting keyboard_layout client for: {current}");
match current {
@ -76,9 +77,7 @@ impl Compositor {
.sway()
.map(|client| client as Arc<dyn KeyboardLayoutClient + Send + Sync>),
#[cfg(feature = "keyboard+hyprland")]
Self::Hyprland => clients
.hyprland()
.map(|client| client as Arc<dyn KeyboardLayoutClient + Send + Sync>),
Self::Hyprland => Ok(clients.hyprland()),
Self::Niri | Self::Unsupported => Err(Report::msg("Unsupported compositor").note(
"Currently keyboard layout functionality are only supported by Sway and Hyprland",
)),
@ -98,9 +97,7 @@ impl Compositor {
.sway()
.map(|client| client as Arc<dyn WorkspaceClient + Send + Sync>),
#[cfg(feature = "workspaces+hyprland")]
Self::Hyprland => clients
.hyprland()
.map(|client| client as Arc<dyn WorkspaceClient + Send + Sync>),
Self::Hyprland => Ok(clients.hyprland()),
#[cfg(feature = "workspaces+niri")]
Self::Niri => Ok(Arc::new(niri::Client::new())),
Self::Unsupported => Err(Report::msg("Unsupported compositor")