chore: Rust 2024 edition

This commit is contained in:
Vukašin Vojinović 2025-10-05 13:45:37 +02:00 committed by Michael Murphy
parent 3b86984332
commit c31a46961a
31 changed files with 48 additions and 48 deletions

View file

@ -1,8 +1,4 @@
edition = "2021" edition = "2024"
hard_tabs = true hard_tabs = true
merge_derives = true
newline_style = "Unix" newline_style = "Unix"
remove_nested_parens = true
reorder_imports = true
reorder_modules = true
use_field_init_shorthand = true use_field_init_shorthand = true

View file

@ -1,7 +1,7 @@
[package] [package]
name = "cosmic-dbus-a11y" name = "cosmic-dbus-a11y"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2024"
[dependencies] [dependencies]
zbus.workspace = true zbus.workspace = true

View file

@ -1,7 +1,7 @@
[package] [package]
name = "accounts-zbus" name = "accounts-zbus"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2024"
license = "MPL-2.0" license = "MPL-2.0"
[dependencies] [dependencies]

View file

@ -3,7 +3,7 @@ name = "bluez-zbus"
version = "0.1.0" version = "0.1.0"
description = "dbus bindings for org.bluez with zbus" description = "dbus bindings for org.bluez with zbus"
repository = "https://github.com/pop-os/dbus-settings-bindings" repository = "https://github.com/pop-os/dbus-settings-bindings"
edition = "2021" edition = "2024"
license = "MPL-2.0" license = "MPL-2.0"
categories = ["os::linux-apis"] categories = ["os::linux-apis"]
keywords = ["dbus", "bluez", "zbus", "bluetooth"] keywords = ["dbus", "bluez", "zbus", "bluetooth"]

View file

@ -45,7 +45,9 @@ pub async fn get_adapters<'a>(
.filter_map(std::result::Result::err) .filter_map(std::result::Result::err)
.collect(); .collect();
if errors.len() > 1 { if errors.len() > 1 {
eprintln!("Multiple errors occurs when fetching connected device: {errors:?}. Only the last one will be returned."); eprintln!(
"Multiple errors occurs when fetching connected device: {errors:?}. Only the last one will be returned."
);
} }
return Err(errors.pop().unwrap()); return Err(errors.pop().unwrap());
} }
@ -165,7 +167,9 @@ pub async fn get_devices<'a>(
.filter_map(std::result::Result::err) .filter_map(std::result::Result::err)
.collect(); .collect();
if errors.len() > 1 { if errors.len() > 1 {
eprintln!("Multiple errors occurs when fetching connected device: {errors:?}. Only the last one will be returned."); eprintln!(
"Multiple errors occurs when fetching connected device: {errors:?}. Only the last one will be returned."
);
} }
return Err(errors.pop().unwrap()); return Err(errors.pop().unwrap());
} }

View file

@ -1,7 +1,7 @@
[package] [package]
name = "cosmic-settings-daemon" name = "cosmic-settings-daemon"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2024"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View file

@ -2,7 +2,7 @@
name = "geoclue2" name = "geoclue2"
description = "zbus-based bindings for GeoClue2 on Linux" description = "zbus-based bindings for GeoClue2 on Linux"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2024"
license = "MPL-2.0" license = "MPL-2.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View file

@ -1,8 +1,7 @@
use serde_repr::{Deserialize_repr, Serialize_repr}; use serde_repr::{Deserialize_repr, Serialize_repr};
use zbus::{ use zbus::{
proxy, Result, proxy,
zvariant::{ObjectPath, OwnedValue, Type}, zvariant::{ObjectPath, OwnedValue, Type},
Result,
}; };
#[repr(u32)] #[repr(u32)]

View file

@ -3,7 +3,7 @@ name = "hostname1-zbus"
version = "0.1.0" version = "0.1.0"
description = "dbus bindings for org.freedesktop.hostname1 with zbus" description = "dbus bindings for org.freedesktop.hostname1 with zbus"
repository = "https://github.com/pop-os/dbus-settings-bindings" repository = "https://github.com/pop-os/dbus-settings-bindings"
edition = "2021" edition = "2024"
license = "MPL-2.0" license = "MPL-2.0"
categories = ["os::linux-apis"] categories = ["os::linux-apis"]
keywords = ["dbus", "hostname", "hostname1", "zbus", "freedesktop"] keywords = ["dbus", "hostname", "hostname1", "zbus", "freedesktop"]

View file

@ -1,7 +1,7 @@
[package] [package]
name = "locale1" name = "locale1"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2024"
[dependencies] [dependencies]
zbus.workspace = true zbus.workspace = true

View file

@ -2,7 +2,7 @@
name = "mpris2-zbus" name = "mpris2-zbus"
description = "zbus-based bindings for MPRIS2 (Media Player Remote Interfacing Specification) on Linux" description = "zbus-based bindings for MPRIS2 (Media Player Remote Interfacing Specification) on Linux"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2024"
license = "MPL-2.0" license = "MPL-2.0"
[dependencies] [dependencies]

View file

@ -1,10 +1,10 @@
// SPDX-License-Identifier: MPL-2.0 // SPDX-License-Identifier: MPL-2.0
use futures_util::{ use futures_util::{
stream::{self, StreamExt},
Stream, Stream,
stream::{self, StreamExt},
}; };
use zbus::{fdo::DBusProxy, names::OwnedBusName, Connection}; use zbus::{Connection, fdo::DBusProxy, names::OwnedBusName};
#[derive(Clone, Debug)] #[derive(Clone, Debug)]
pub enum Event { pub enum Event {

View file

@ -11,7 +11,7 @@ use crate::{
track_list::TrackList, track_list::TrackList,
}; };
use std::ops::Deref; use std::ops::Deref;
use zbus::{names::OwnedBusName, Connection}; use zbus::{Connection, names::OwnedBusName};
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct MediaPlayer { pub struct MediaPlayer {

View file

@ -13,7 +13,7 @@ use std::{
str::FromStr, str::FromStr,
}; };
use time::Duration; use time::Duration;
use zbus::{names::OwnedBusName, Connection}; use zbus::{Connection, names::OwnedBusName};
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct Player { pub struct Player {

View file

@ -8,7 +8,7 @@ use crate::{
error::{Error, Result}, error::{Error, Result},
}; };
use std::ops::Deref; use std::ops::Deref;
use zbus::{names::OwnedBusName, Connection}; use zbus::{Connection, names::OwnedBusName};
pub struct Playlists { pub struct Playlists {
proxy: PlaylistsProxy<'static>, proxy: PlaylistsProxy<'static>,

View file

@ -6,7 +6,7 @@ use crate::{
track::TrackId, track::TrackId,
}; };
use std::{collections::BTreeMap, ops::Deref}; use std::{collections::BTreeMap, ops::Deref};
use zbus::{names::OwnedBusName, Connection}; use zbus::{Connection, names::OwnedBusName};
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct TrackList { pub struct TrackList {

View file

@ -1,7 +1,7 @@
[package] [package]
name = "cosmic-dbus-networkmanager" name = "cosmic-dbus-networkmanager"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2024"
license = "MPL-2.0" license = "MPL-2.0"
[dependencies] [dependencies]

View file

@ -13,8 +13,9 @@ use crate::{
active_connection::ActiveConnectionProxy, active_connection::ActiveConnectionProxy,
config::{ip4::Ipv4ConfigProxy, ip6::Ipv6ConfigProxy}, config::{ip4::Ipv4ConfigProxy, ip6::Ipv6ConfigProxy},
device::{ device::{
bluetooth::BluetoothDeviceProxy, tun::TunDeviceProxy, wired::WiredDeviceProxy, DeviceProxy, bluetooth::BluetoothDeviceProxy, tun::TunDeviceProxy,
wireguard::WireGuardDeviceProxy, wireless::WirelessDeviceProxy, DeviceProxy, wired::WiredDeviceProxy, wireguard::WireGuardDeviceProxy,
wireless::WirelessDeviceProxy,
}, },
enums::{DeviceCapabilities, DeviceState, DeviceType}, enums::{DeviceCapabilities, DeviceState, DeviceType},
settings::connection::ConnectionSettingsProxy, settings::connection::ConnectionSettingsProxy,

View file

@ -1,7 +1,7 @@
// SPDX-License-Identifier: MPL-2.0 // SPDX-License-Identifier: MPL-2.0
use super::Device; use super::Device;
use crate::interface::device::{bluetooth::BluetoothDeviceProxy, DeviceProxy}; use crate::interface::device::{DeviceProxy, bluetooth::BluetoothDeviceProxy};
use std::ops::Deref; use std::ops::Deref;
use zbus::Result; use zbus::Result;

View file

@ -1,7 +1,7 @@
// SPDX-License-Identifier: MPL-2.0 // SPDX-License-Identifier: MPL-2.0
use super::Device; use super::Device;
use crate::interface::device::{tun::TunDeviceProxy, DeviceProxy}; use crate::interface::device::{DeviceProxy, tun::TunDeviceProxy};
use std::ops::Deref; use std::ops::Deref;
use zbus::Result; use zbus::Result;

View file

@ -1,7 +1,7 @@
// SPDX-License-Identifier: MPL-2.0 // SPDX-License-Identifier: MPL-2.0
use super::Device; use super::Device;
use crate::interface::device::{wired::WiredDeviceProxy, DeviceProxy}; use crate::interface::device::{DeviceProxy, wired::WiredDeviceProxy};
use std::ops::Deref; use std::ops::Deref;
use zbus::Result; use zbus::Result;

View file

@ -1,7 +1,7 @@
// SPDX-License-Identifier: MPL-2.0 // SPDX-License-Identifier: MPL-2.0
use super::Device; use super::Device;
use crate::interface::device::{wireguard::WireGuardDeviceProxy, DeviceProxy}; use crate::interface::device::{DeviceProxy, wireguard::WireGuardDeviceProxy};
use std::ops::Deref; use std::ops::Deref;
use zbus::Result; use zbus::Result;

View file

@ -5,7 +5,7 @@ use crate::{
access_point::AccessPoint, access_point::AccessPoint,
interface::{ interface::{
access_point::AccessPointProxy, access_point::AccessPointProxy,
device::{wireless::WirelessDeviceProxy, DeviceProxy}, device::{DeviceProxy, wireless::WirelessDeviceProxy},
enums::{WifiCapabilities, WifiMode}, enums::{WifiCapabilities, WifiMode},
}, },
}; };

View file

@ -4,15 +4,15 @@ use crate::{
active_connection::ActiveConnection, active_connection::ActiveConnection,
device::Device, device::Device,
interface::{ interface::{
NetworkManagerProxy,
active_connection::ActiveConnectionProxy, active_connection::ActiveConnectionProxy,
device::DeviceProxy, device::DeviceProxy,
enums::{NmConnectivityState, NmState}, enums::{NmConnectivityState, NmState},
NetworkManagerProxy,
}, },
settings::{connection::Connection, NetworkManagerSettings}, settings::{NetworkManagerSettings, connection::Connection},
}; };
use std::ops::Deref; use std::ops::Deref;
use zbus::{zvariant::ObjectPath, Result}; use zbus::{Result, zvariant::ObjectPath};
#[derive(Debug)] #[derive(Debug)]
pub struct NetworkManager<'a>(NetworkManagerProxy<'a>); pub struct NetworkManager<'a>(NetworkManagerProxy<'a>);

View file

@ -3,7 +3,7 @@
pub mod connection; pub mod connection;
use self::connection::Connection; use self::connection::Connection;
use crate::interface::settings::{connection::ConnectionSettingsProxy, SettingsProxy}; use crate::interface::settings::{SettingsProxy, connection::ConnectionSettingsProxy};
use std::ops::Deref; use std::ops::Deref;
use zbus::Result; use zbus::Result;

View file

@ -1,7 +1,7 @@
[package] [package]
name = "switcheroo-control" name = "switcheroo-control"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2024"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View file

@ -4,7 +4,7 @@ version = "0.1.0"
description = "a dbus client (using zbus) for timedate" description = "a dbus client (using zbus) for timedate"
repository = "https://github.com/pop-os/dbus-settings-bindings" repository = "https://github.com/pop-os/dbus-settings-bindings"
license = "MPL-2.0" license = "MPL-2.0"
edition = "2021" edition = "2024"
categories = ["os::unix-apis"] categories = ["os::unix-apis"]
keywords = ["systemd", "timedate", "zbus"] keywords = ["systemd", "timedate", "zbus"]

View file

@ -8,7 +8,7 @@ readme = "README.md"
license = "MIT" license = "MIT"
categories = ["os::unix-apis"] categories = ["os::unix-apis"]
keywords = ["linux", "systemd", "logind", "dbus", "zbus"] keywords = ["linux", "systemd", "logind", "dbus", "zbus"]
edition = "2018" edition = "2024"
[dependencies] [dependencies]
serde.workspace = true serde.workspace = true