fix clippy warnings

This commit is contained in:
Samuel Onoja committed 2026-10-01 13:24:21 +01:00
1 parent 7b88083020
commit bdc3ba435f
39 files changed
+825 -688

No files matched your search

+23 -9
View File
@@ -393,12 +393,14 @@ impl Backend {
let sharing = start_streams(
&app_id,
&parent_window,
multiple,
cursor,
source_types,
persist_mode,
restore,
bar_controlled,
StreamOptions {
multiple,
cursor,
source_types,
requested_persistence: persist_mode,
restore,
bar_controlled,
},
);
let result = tokio::select! {
_ = cancel.wait() => Err(StartError::Cancelled),
@@ -534,16 +536,28 @@ async fn picker(prompt: &Prompt) -> Result<Child, String> {
Ok(child)
}
async fn start_streams(
app: &str,
parent: &str,
struct StreamOptions {
multiple: bool,
cursor: bool,
source_types: u32,
requested_persistence: u32,
restore: Option<crate::restore::Restore>,
bar_controlled: bool,
}
async fn start_streams(
app: &str,
parent: &str,
options: StreamOptions,
) -> Result<(Vec<Child>, Vec<(u32, Options)>, Options), StartError> {
let StreamOptions {
multiple,
cursor,
source_types,
requested_persistence,
restore,
bar_controlled,
} = options;
let mut discovery = tokio::task::spawn_blocking(|| Capture::connect(&AtomicBool::new(false)))
.await
.map_err(|e| e.to_string())??;
+3 -3
View File
@@ -29,9 +29,9 @@ pub(crate) struct ShortcutField {
#[derive(Clone, Debug)]
enum Message {
ThemeChanged(ferese_config::theme::Snapshot),
ThemeChanged(Box<ferese_config::theme::Snapshot>),
Opened(cosmic::iced::window::Id),
Attached(Result<(Option<Arc<crate::parent::Parent>>, Result<ModalMaterial, String>), String>),
Attached(crate::parent::Attachment),
Accept,
Cancel,
Shortcut(usize, String),
@@ -110,7 +110,7 @@ impl cosmic::Application for Consent {
fn subscription(&self) -> cosmic::iced::Subscription<Message> {
cosmic::iced::Subscription::batch([
ferese_theme::service::subscription().map(Message::ThemeChanged),
ferese_theme::service::subscription().map(|snapshot| Message::ThemeChanged(Box::new(snapshot))),
cosmic::iced::event::listen_with(|event, _, id| match event {
cosmic::iced::Event::Window(cosmic::iced::window::Event::Opened { .. }) => Some(Message::Opened(id)),
cosmic::iced::Event::Keyboard(cosmic::iced::keyboard::Event::KeyPressed {
+7 -1
View File
@@ -21,8 +21,10 @@ const PATH: &str = "/org/freedesktop/portal/desktop";
const MAX_IMAGE_BYTES: u64 = 128 * 1024 * 1024;
type Reply = (u32, Options);
type RequestMap = HashMap<String, (String, Arc<Cancel>)>;
#[derive(Clone)]
pub(crate) struct Requests(Arc<Mutex<HashMap<String, (String, Arc<Cancel>)>>>, usize);
pub(crate) struct Requests(Arc<Mutex<RequestMap>>, usize);
impl Default for Requests {
fn default() -> Self {
@@ -141,6 +143,10 @@ pub(crate) struct Wallpaper(pub(crate) Requests);
#[zbus::interface(name = "org.freedesktop.impl.portal.Wallpaper")]
impl Wallpaper {
#[zbus(name = "SetWallpaperURI")]
#[allow(
clippy::too_many_arguments,
reason = "Signature is defined by the portal D-Bus interface"
)]
async fn set_wallpaper_uri(
&self,
handle: OwnedObjectPath,
+4
View File
@@ -258,6 +258,10 @@ async fn login_inhibitor(what: &str, app: &str, reason: &str) -> Result<Option<O
#[zbus::interface(name = "org.freedesktop.impl.portal.Inhibit")]
impl Inhibit {
#[allow(
clippy::too_many_arguments,
reason = "Signature is defined by the portal D-Bus interface"
)]
async fn inhibit(
&self,
handle: OwnedObjectPath,
+8
View File
@@ -1,3 +1,11 @@
pub(crate) type Attachment = Result<
(
Option<std::sync::Arc<Parent>>,
Result<ferese_theme::material::ModalMaterial, String>,
),
String,
>;
use wayland_client::globals::{GlobalListContents, registry_queue_init};
use wayland_client::protocol::{wl_registry, wl_surface};
use wayland_client::{Connection, Dispatch, Proxy, QueueHandle, delegate_noop};
+4
View File
@@ -24,6 +24,10 @@ impl Usb {
1
}
#[allow(
clippy::too_many_arguments,
reason = "Signature is defined by the portal D-Bus interface"
)]
async fn acquire_devices(
&self,
handle: OwnedObjectPath,
+3 -11
View File
@@ -52,17 +52,9 @@ pub(crate) struct Selection {
#[derive(Clone, Debug)]
enum Message {
ThemeChanged(ferese_config::theme::Snapshot),
ThemeChanged(Box<ferese_config::theme::Snapshot>),
WindowOpened(cosmic::iced::window::Id),
Attached(
Result<
(
Option<std::sync::Arc<crate::parent::Parent>>,
Result<ferese_theme::material::ModalMaterial, String>,
),
String,
>,
),
Attached(crate::parent::Attachment),
Select(usize),
Remember,
Share,
@@ -161,7 +153,7 @@ impl cosmic::Application for Picker {
fn subscription(&self) -> cosmic::iced::Subscription<Message> {
cosmic::iced::Subscription::batch([
ferese_theme::service::subscription().map(Message::ThemeChanged),
ferese_theme::service::subscription().map(|snapshot| Message::ThemeChanged(Box::new(snapshot))),
cosmic::iced::event::listen_with(|event, _, id| match event {
cosmic::iced::Event::Window(cosmic::iced::window::Event::Opened { .. }) => {
Some(Message::WindowOpened(id))
+4 -2
View File
@@ -282,8 +282,10 @@ mod tests {
#[test]
fn reports_ferese_theme_and_reduced_motion() {
let mut resolved = ResolvedTheme::default();
resolved.appearance = ThemeAppearance::Light;
let mut resolved = ResolvedTheme {
appearance: ThemeAppearance::Light,
..Default::default()
};
resolved.tokens.colors.accent = "#ff8000".into();
resolved.reduced_motion = true;
resolved.accessibility.increase_contrast = true;
+4
View File
@@ -310,6 +310,10 @@ impl GlobalShortcuts {
result
}
#[allow(
clippy::too_many_arguments,
reason = "Signature is defined by the portal D-Bus interface"
)]
async fn bind_shortcuts(
&self,
handle: OwnedObjectPath,