chore: Rust 2024 edition
This commit is contained in:
parent
3b86984332
commit
c31a46961a
31 changed files with 48 additions and 48 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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]
|
||||||
|
|
|
||||||
|
|
@ -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"]
|
||||||
|
|
|
||||||
|
|
@ -32,5 +32,5 @@ pub trait HealthManager1 {
|
||||||
|
|
||||||
/// DestroyApplication method
|
/// DestroyApplication method
|
||||||
fn destroy_application(&self, application: &zbus::zvariant::ObjectPath<'_>)
|
fn destroy_application(&self, application: &zbus::zvariant::ObjectPath<'_>)
|
||||||
-> zbus::Result<()>;
|
-> zbus::Result<()>;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
||||||
|
|
@ -12,4 +12,4 @@ zbus.workspace = true
|
||||||
futures = "0.3"
|
futures = "0.3"
|
||||||
tokio = { version = "1", features = ["full"] }
|
tokio = { version = "1", features = ["full"] }
|
||||||
zbus.workspace = true
|
zbus.workspace = true
|
||||||
zbus.features = ["tokio"]
|
zbus.features = ["tokio"]
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
@ -10,4 +10,4 @@ license = "MPL-2.0"
|
||||||
[dependencies]
|
[dependencies]
|
||||||
serde.workspace = true
|
serde.workspace = true
|
||||||
serde_repr = "0.1.18"
|
serde_repr = "0.1.18"
|
||||||
zbus.workspace = true
|
zbus.workspace = true
|
||||||
|
|
|
||||||
|
|
@ -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)]
|
||||||
|
|
|
||||||
|
|
@ -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"]
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
@ -10,4 +10,4 @@ zbus.workspace = true
|
||||||
futures = "0.3"
|
futures = "0.3"
|
||||||
tokio = { version = "1", features = ["full"] }
|
tokio = { version = "1", features = ["full"] }
|
||||||
zbus.workspace = true
|
zbus.workspace = true
|
||||||
zbus.features = ["tokio"]
|
zbus.features = ["tokio"]
|
||||||
|
|
|
||||||
|
|
@ -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]
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ use zbus::proxy;
|
||||||
pub trait TrackList {
|
pub trait TrackList {
|
||||||
/// AddTrack method
|
/// AddTrack method
|
||||||
fn add_track(&self, uri: &str, after_track: &TrackId, set_as_current: bool)
|
fn add_track(&self, uri: &str, after_track: &TrackId, set_as_current: bool)
|
||||||
-> zbus::Result<()>;
|
-> zbus::Result<()>;
|
||||||
|
|
||||||
/// GetTracksMetadata method
|
/// GetTracksMetadata method
|
||||||
fn get_tracks_metadata(
|
fn get_tracks_metadata(
|
||||||
|
|
@ -46,7 +46,7 @@ pub trait TrackList {
|
||||||
/// TrackListReplaced signal
|
/// TrackListReplaced signal
|
||||||
#[zbus(signal)]
|
#[zbus(signal)]
|
||||||
fn track_list_replaced(&self, tracks: Vec<TrackId>, current_track: TrackId)
|
fn track_list_replaced(&self, tracks: Vec<TrackId>, current_track: TrackId)
|
||||||
-> zbus::Result<()>;
|
-> zbus::Result<()>;
|
||||||
|
|
||||||
/// CanEditTracks property
|
/// CanEditTracks property
|
||||||
#[zbus(property)]
|
#[zbus(property)]
|
||||||
|
|
|
||||||
|
|
@ -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 {
|
||||||
|
|
|
||||||
|
|
@ -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 {
|
||||||
|
|
|
||||||
|
|
@ -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 {
|
||||||
|
|
|
||||||
|
|
@ -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>,
|
||||||
|
|
|
||||||
|
|
@ -8,14 +8,14 @@ pub struct Playlist((PlaylistId, String, String));
|
||||||
|
|
||||||
impl Playlist {
|
impl Playlist {
|
||||||
pub fn id(&self) -> &PlaylistId {
|
pub fn id(&self) -> &PlaylistId {
|
||||||
&self.0 .0
|
&self.0.0
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn name(&self) -> &str {
|
pub fn name(&self) -> &str {
|
||||||
&self.0 .1
|
&self.0.1
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn icon(&self) -> &str {
|
pub fn icon(&self) -> &str {
|
||||||
&self.0 .2
|
&self.0.2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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 {
|
||||||
|
|
|
||||||
|
|
@ -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]
|
||||||
|
|
|
||||||
|
|
@ -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,
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -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>);
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
||||||
|
|
@ -12,4 +12,4 @@ zbus.workspace = true
|
||||||
futures = "0.3"
|
futures = "0.3"
|
||||||
tokio = { version = "1", features = ["full"] }
|
tokio = { version = "1", features = ["full"] }
|
||||||
zbus.workspace = true
|
zbus.workspace = true
|
||||||
zbus.features = ["tokio"]
|
zbus.features = ["tokio"]
|
||||||
|
|
|
||||||
|
|
@ -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"]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue