Skip to content

Commit

Permalink
chore: clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
hoodie committed Nov 26, 2023
1 parent 3b3b6d9 commit 6601b88
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
5 changes: 3 additions & 2 deletions src/xdg/dbus_rs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ pub fn send_notification_via_connection_at_bus(

let reply = connection.send_with_reply_and_block(message, 2000)?;

match reply.get_items().get(0) {
match reply.get_items().first() {
Some(MessageItem::UInt32(ref id)) => Ok(*id),
_ => Ok(0),
}
Expand Down Expand Up @@ -220,7 +220,7 @@ pub fn get_capabilities() -> Result<Vec<String>> {
let connection = Connection::get_private(BusType::Session)?;
let reply = connection.send_with_reply_and_block(message, 2000)?;

if let Some(MessageItem::Array(items)) = reply.get_items().get(0) {
if let Some(MessageItem::Array(items)) = reply.get_items().first() {
for item in items.iter() {
if let MessageItem::Str(ref cap) = *item {
capabilities.push(cap.clone());
Expand All @@ -238,6 +238,7 @@ fn unwrap_message_string(item: Option<&MessageItem>) -> String {
}
}

#[allow(clippy::get_first)]
pub fn get_server_information() -> Result<ServerInformation> {
let message = build_message("GetServerInformation", Default::default());
let connection = Connection::get_private(BusType::Session)?;
Expand Down
12 changes: 6 additions & 6 deletions src/xdg/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ use zbus_rs::bus;
#[cfg(all(feature = "dbus", feature = "zbus"))]
mod bus;

#[cfg(all(feature = "server", feature = "dbus", unix, not(target_os = "macos")))]
pub mod server_dbus;
// #[cfg(all(feature = "server", feature = "dbus", unix, not(target_os = "macos")))]
// pub mod server_dbus;

#[cfg(all(feature = "server", feature = "zbus", unix, not(target_os = "macos")))]
pub mod server_zbus;
// #[cfg(all(feature = "server", feature = "zbus", unix, not(target_os = "macos")))]
// pub mod server_zbus;

#[cfg(all(feature = "server", unix, not(target_os = "macos")))]
pub mod server;
// #[cfg(all(feature = "server", unix, not(target_os = "macos")))]
// pub mod server;

#[cfg(not(feature = "debug_namespace"))]
#[doc(hidden)]
Expand Down

0 comments on commit 6601b88

Please sign in to comment.