chore: update to Rust 2024 edition

This commit is contained in:
Vukašin Vojinović 2025-08-12 21:38:51 +02:00 committed by Michael Murphy
parent c3fafd3910
commit 2b7b4cba56
71 changed files with 254 additions and 292 deletions

View file

@ -2,7 +2,7 @@
name = "cosmic-applet-workspaces"
version = "0.1.1"
authors = ["Ashley Wulber <ashley@system76.com>"]
edition = "2021"
edition = "2024"
license = "GPL-3.0-only"
[dependencies]

View file

@ -11,26 +11,24 @@ use cctk::{
workspace::Workspace,
};
use cosmic::{
app,
Element, Task, Theme, app,
applet::cosmic_panel_config::PanelAnchor,
iced::{
event,
mouse::{self, ScrollDelta},
widget::{button, column, row},
Alignment,
Event::Mouse,
Length, Limits, Subscription,
Length, Limits, Subscription, event,
mouse::{self, ScrollDelta},
widget::{button, column, row},
},
iced_core::{Background, Border},
surface,
widget::{autosize, container, horizontal_space, vertical_space, Id},
Element, Task, Theme,
widget::{Id, autosize, container, horizontal_space, vertical_space},
};
use crate::{
config,
wayland::WorkspaceEvent,
wayland_subscription::{workspaces, WorkspacesUpdate},
wayland_subscription::{WorkspacesUpdate, workspaces},
};
use std::{
@ -187,11 +185,7 @@ impl cosmic::Application for IcedWorkspacesApplet {
{
let max_w = self.workspaces.len().wrapping_sub(1);
let d_i = if self.scroll > 0.0 {
if w_i == 0 {
max_w
} else {
w_i.wrapping_sub(1)
}
if w_i == 0 { max_w } else { w_i.wrapping_sub(1) }
} else if w_i == max_w {
0
} else {

View file

@ -2,8 +2,8 @@
// SPDX-License-Identifier: GPL-3.0-only
use i18n_embed::{
fluent::{fluent_language_loader, FluentLanguageLoader},
DefaultLocalizer, LanguageLoader, Localizer,
fluent::{FluentLanguageLoader, fluent_language_loader},
};
use rust_embed::RustEmbed;
use std::sync::LazyLock;

View file

@ -16,15 +16,15 @@ use cctk::{
},
workspace::{Workspace, WorkspaceHandler, WorkspaceState},
};
use futures::{channel::mpsc, executor::block_on, SinkExt};
use futures::{SinkExt, channel::mpsc, executor::block_on};
use std::os::{
fd::{FromRawFd, RawFd},
unix::net::UnixStream,
};
use wayland_client::{
Connection, QueueHandle,
globals::registry_queue_init,
protocol::wl_output::{self, WlOutput},
Connection, QueueHandle,
};
#[derive(Debug, Clone)]

View file

@ -4,9 +4,9 @@
use crate::wayland::{self, WorkspaceEvent};
use cctk::{sctk::reexports::calloop::channel::SyncSender, workspace::Workspace};
use cosmic::iced::{
self,
futures::{channel::mpsc, SinkExt, StreamExt},
stream, Subscription,
self, Subscription,
futures::{SinkExt, StreamExt, channel::mpsc},
stream,
};
use std::sync::LazyLock;
use tokio::sync::Mutex;