chore: add rustfmt config

This commit is contained in:
Vukašin Vojinović 2026-05-04 18:02:46 +02:00 committed by Jacob Kauffmann
parent cb4a0d3a3a
commit 4b1f388a4f
78 changed files with 394 additions and 485 deletions

View file

@ -1,17 +1,11 @@
use cosmic_protocols::a11y::v1::client::cosmic_a11y_manager_v1::{self, ActiveState};
use num_derive::{FromPrimitive, ToPrimitive};
use sctk::{
reexports::{
calloop::{self, LoopSignal, channel},
calloop_wayland_source::WaylandSource,
client::{
ConnectError, Connection, Dispatch, Proxy, WEnum,
globals::{GlobalListContents, registry_queue_init},
protocol::wl_registry,
},
},
registry::RegistryState,
};
use sctk::reexports::calloop::{self, LoopSignal, channel};
use sctk::reexports::calloop_wayland_source::WaylandSource;
use sctk::reexports::client::globals::{GlobalListContents, registry_queue_init};
use sctk::reexports::client::protocol::wl_registry;
use sctk::reexports::client::{ConnectError, Connection, Dispatch, Proxy, WEnum};
use sctk::registry::RegistryState;
use tokio::sync::mpsc;
#[derive(Debug, Clone, Copy)]

View file

@ -42,8 +42,9 @@ fn is_airplane_mode(rfkill_state: &HashMap<u32, rfkill::DeviceState>) -> bool {
mod rfkill {
use futures::stream::Stream;
use std::collections::HashMap;
use std::os::unix::fs::OpenOptionsExt;
use std::{collections::HashMap, fs, io, mem, slice};
use std::{fs, io, mem, slice};
use tokio::io::unix::AsyncFd;
// /usr/include/linux/rfkill.h

View file

@ -2,13 +2,11 @@
// SPDX-License-Identifier: MPL-2.0
use crate::{Active, Event};
use std::{
collections::HashMap,
convert::Infallible,
hash::{Hash, Hasher},
path::PathBuf,
time::Duration,
};
use std::collections::HashMap;
use std::convert::Infallible;
use std::hash::{Hash, Hasher};
use std::path::PathBuf;
use std::time::Duration;
use zbus::zvariant::OwnedObjectPath;
#[derive(Default, Debug, Clone)]

View file

@ -3,11 +3,9 @@
use crate::{Active, Event};
use futures::join;
use std::{
collections::HashMap,
hash::{Hash, Hasher},
time::Duration,
};
use std::collections::HashMap;
use std::hash::{Hash, Hasher};
use std::time::Duration;
use zbus::zvariant::OwnedObjectPath;
const DEFAILT_DEVICE_ICON: &str = "bluetooth-symbolic";

View file

@ -5,9 +5,11 @@ use crate::{AdapterUpdate, Device, DeviceUpdate, Event};
use std::pin::Pin;
use bluez_zbus::BluetoothDevice;
use futures::{channel::mpsc, stream::FusedStream};
use futures::channel::mpsc;
use futures::stream::FusedStream;
use iced_futures::futures::{SinkExt, StreamExt};
use zbus::{fdo, zvariant::OwnedObjectPath};
use zbus::fdo;
use zbus::zvariant::OwnedObjectPath;
enum DevicePropertyWatcherTask {
Add(OwnedObjectPath),

View file

@ -7,7 +7,8 @@ use super::Event;
use cosmic_dbus_networkmanager::nm::NetworkManager;
use futures::{SinkExt, StreamExt};
use iced_futures::{Subscription, stream};
use std::{fmt::Debug, hash::Hash};
use std::fmt::Debug;
use std::hash::Hash;
use zbus::Connection;
#[derive(Debug, Clone)]

View file

@ -1,14 +1,13 @@
// Copyright 2024 System76 <info@system76.com>
// SPDX-License-Identifier: MPL-2.0
use cosmic_dbus_networkmanager::{
device::wireless::WirelessDevice,
interface::enums::{ApFlags, ApSecurityFlags, DeviceState},
};
use cosmic_dbus_networkmanager::device::wireless::WirelessDevice;
use cosmic_dbus_networkmanager::interface::enums::{ApFlags, ApSecurityFlags, DeviceState};
use futures::StreamExt;
use itertools::Itertools;
use std::{collections::HashMap, sync::Arc};
use std::collections::HashMap;
use std::sync::Arc;
use zbus::zvariant::ObjectPath;
use super::hw_address::HwAddress;

View file

@ -1,10 +1,9 @@
// Copyright 2024 System76 <info@system76.com>
// SPDX-License-Identifier: MPL-2.0
use cosmic_dbus_networkmanager::{
active_connection::ActiveConnection, device::SpecificDevice,
interface::enums::ActiveConnectionState,
};
use cosmic_dbus_networkmanager::active_connection::ActiveConnection;
use cosmic_dbus_networkmanager::device::SpecificDevice;
use cosmic_dbus_networkmanager::interface::enums::ActiveConnectionState;
use std::net::Ipv4Addr;
pub async fn active_connections(

View file

@ -10,8 +10,11 @@ use core::hash;
use cosmic_dbus_networkmanager::nm::NetworkManager;
use futures::{SinkExt, StreamExt};
use iced_futures::{self, Subscription, stream};
use std::{fmt::Debug, hash::Hash, sync::Arc};
use zbus::{Connection, zvariant::ObjectPath};
use std::fmt::Debug;
use std::hash::Hash;
use std::sync::Arc;
use zbus::Connection;
use zbus::zvariant::ObjectPath;
#[derive(Debug, Clone, Eq, PartialEq)]
pub struct DeviceInfo {

View file

@ -9,34 +9,33 @@ pub mod hw_address;
pub mod nm_secret_agent;
pub mod wireless_enabled;
use std::{collections::HashMap, fmt::Debug, hash::Hash, sync::Arc, time::Duration};
use std::collections::HashMap;
use std::fmt::Debug;
use std::hash::Hash;
use std::sync::Arc;
use std::time::Duration;
use available_wifi::NetworkType;
pub use cosmic_dbus_networkmanager as dbus;
pub use dbus::settings::connection::Settings;
use cosmic_dbus_networkmanager::{
device::SpecificDevice,
interface::{
enums::{self, ActiveConnectionState, DeviceType, NmConnectivityState},
settings::connection::ConnectionSettingsProxy,
},
nm::NetworkManager,
settings::{NetworkManagerSettings, connection::Connection},
};
use futures::{
FutureExt, SinkExt, StreamExt,
channel::mpsc::{UnboundedReceiver, UnboundedSender, unbounded},
use cosmic_dbus_networkmanager::device::SpecificDevice;
use cosmic_dbus_networkmanager::interface::enums::{
self, ActiveConnectionState, DeviceType, NmConnectivityState,
};
use cosmic_dbus_networkmanager::interface::settings::connection::ConnectionSettingsProxy;
use cosmic_dbus_networkmanager::nm::NetworkManager;
use cosmic_dbus_networkmanager::settings::NetworkManagerSettings;
use cosmic_dbus_networkmanager::settings::connection::Connection;
use futures::channel::mpsc::{UnboundedReceiver, UnboundedSender, unbounded};
use futures::{FutureExt, SinkExt, StreamExt};
use iced_futures::{Subscription, stream};
use secure_string::SecureString;
use tokio::process::Command;
use zbus::zvariant::{self, ObjectPath, Value};
use self::{
available_wifi::{AccessPoint, handle_wireless_device},
current_networks::{ActiveConnectionInfo, active_connections},
};
use self::available_wifi::{AccessPoint, handle_wireless_device};
use self::current_networks::{ActiveConnectionInfo, active_connections};
pub type SSID = Arc<str>;
pub type UUID = Arc<str>;

View file

@ -1,18 +1,14 @@
use std::{
collections::{HashMap, HashSet},
fmt::Debug,
sync::Arc,
};
use std::collections::{HashMap, HashSet};
use std::fmt::Debug;
use std::sync::Arc;
use bitflags::bitflags;
use cosmic_dbus_networkmanager::interface::settings::connection::ConnectionSettingsProxy;
use futures::{SinkExt, Stream};
use secure_string::SecureString;
use tokio::sync::oneshot;
use zbus::{
ObjectServer, fdo,
zvariant::{OwnedValue, Str},
};
use zbus::zvariant::{OwnedValue, Str};
use zbus::{ObjectServer, fdo};
pub type SecretSender = Arc<tokio::sync::Mutex<Option<tokio::sync::oneshot::Sender<SecureString>>>>;

View file

@ -7,7 +7,8 @@ use super::Event;
use cosmic_dbus_networkmanager::nm::NetworkManager;
use futures::{SinkExt, StreamExt};
use iced_futures::{Subscription, stream};
use std::{fmt::Debug, hash::Hash};
use std::fmt::Debug;
use std::hash::Hash;
use zbus::Connection;
#[derive(Debug, Clone)]

View file

@ -4,37 +4,30 @@
// Make sure not to fail if pulse not found, and reconnect?
// change to device shouldn't send osd?
use futures::{SinkExt, executor::block_on};
use futures::SinkExt;
use futures::executor::block_on;
use iced_futures::{Subscription, stream};
use libpulse_binding::{
callbacks::ListResult,
channelmap::Map,
context::{
Context, FlagSet, State,
introspect::{CardInfo, CardProfileInfo, Introspector, ServerInfo, SinkInfo, SourceInfo},
subscribe::{Facility, InterestMaskSet, Operation},
},
def::{PortAvailable, Retval},
mainloop::{
api::MainloopApi,
events::io::IoEventInternal,
standard::{IterateResult, Mainloop},
},
volume::{ChannelVolumes, Volume},
};
use std::{
borrow::Cow,
cell::{Cell, RefCell},
convert::Infallible,
io::{Read, Write},
os::{
fd::{FromRawFd, IntoRawFd, RawFd},
raw::c_void,
},
rc::Rc,
str::FromStr,
sync::mpsc,
use libpulse_binding::callbacks::ListResult;
use libpulse_binding::channelmap::Map;
use libpulse_binding::context::introspect::{
CardInfo, CardProfileInfo, Introspector, ServerInfo, SinkInfo, SourceInfo,
};
use libpulse_binding::context::subscribe::{Facility, InterestMaskSet, Operation};
use libpulse_binding::context::{Context, FlagSet, State};
use libpulse_binding::def::{PortAvailable, Retval};
use libpulse_binding::mainloop::api::MainloopApi;
use libpulse_binding::mainloop::events::io::IoEventInternal;
use libpulse_binding::mainloop::standard::{IterateResult, Mainloop};
use libpulse_binding::volume::{ChannelVolumes, Volume};
use std::borrow::Cow;
use std::cell::{Cell, RefCell};
use std::convert::Infallible;
use std::io::{Read, Write};
use std::os::fd::{FromRawFd, IntoRawFd, RawFd};
use std::os::raw::c_void;
use std::rc::Rc;
use std::str::FromStr;
use std::sync::mpsc;
pub fn subscription() -> iced_futures::Subscription<Event> {
Subscription::run_with("pulse", |_| {

View file

@ -7,11 +7,9 @@ use cosmic_pipewire as pipewire;
use futures::{SinkExt, Stream};
use intmap::IntMap;
use pipewire::Availability;
use std::{
process::Stdio,
sync::{Arc, Mutex},
time::Duration,
};
use std::process::Stdio;
use std::sync::{Arc, Mutex};
use std::time::Duration;
pub type DeviceId = u32;
pub type NodeId = u32;

View file

@ -4,7 +4,8 @@
pub mod device {
use futures::{FutureExt, Stream, StreamExt};
use iced_futures::Subscription;
use std::{fmt::Debug, hash::Hash};
use std::fmt::Debug;
use std::hash::Hash;
use upower_dbus::{BatteryType, DeviceProxy, UPowerProxy};
pub fn device_subscription<I: 'static + Hash + Copy + Send + Sync + Debug>(
@ -97,7 +98,8 @@ pub mod kbdbacklight {
use futures::{FutureExt, Stream, StreamExt};
use iced_futures::Subscription;
use std::{fmt::Debug, hash::Hash};
use std::fmt::Debug;
use std::hash::Hash;
use tokio::sync::mpsc::{UnboundedSender, unbounded_channel};
use tokio_stream::wrappers::UnboundedReceiverStream;
use upower_dbus::{BrightnessChanged, KbdBacklightProxy};