From 77d0d73ed78ea5fab9243082dc248cab67382c08 Mon Sep 17 00:00:00 2001 From: Eric Coissac Date: Sat, 4 Apr 2026 00:57:33 +0200 Subject: [PATCH] :wastebasket: Remove unused imports and format code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Comment out `use std::simd::*` in pmoaudio as it's unused and modules import their own SIMD - Remove `Instant` from imports in track_metadata.rs (unused) - Reorder anyhow import to match Rust convention (`anyhow, Result` → `Result`) and remove unused imports - Improve XML response logging readability with line breaks in iterator chain + Refactor `get()` method to multi-line for clarity and consistency --- pmoaudio/src/lib.rs | 2 +- pmoaudiocache/src/track_metadata.rs | 2 +- pmocontrol/src/upnp_clients/openhome_client.rs | 17 +++++++++++------ 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/pmoaudio/src/lib.rs b/pmoaudio/src/lib.rs index 43b9568c..5a2bfd72 100755 --- a/pmoaudio/src/lib.rs +++ b/pmoaudio/src/lib.rs @@ -78,7 +78,7 @@ async fn main() { - **RwLock** : Pour partage concurrent du compteur [`TimerNode`] "#] #[cfg(feature = "simd")] -use std::simd::*; +// use std::simd::*; // Not actually used in this file, modules import their own simd mod audio_chunk; mod audio_segment; diff --git a/pmoaudiocache/src/track_metadata.rs b/pmoaudiocache/src/track_metadata.rs index 582748fb..49558293 100644 --- a/pmoaudiocache/src/track_metadata.rs +++ b/pmoaudiocache/src/track_metadata.rs @@ -1,5 +1,5 @@ use std::sync::Arc; -use std::time::{Duration, Instant, SystemTime, UNIX_EPOCH}; +use std::time::{Duration, SystemTime, UNIX_EPOCH}; use pmometadata::{MetadataError, MetadataResult, TrackMetadata}; use serde_json::{Number, Value}; diff --git a/pmocontrol/src/upnp_clients/openhome_client.rs b/pmocontrol/src/upnp_clients/openhome_client.rs index 34bc26e3..6d8d0af0 100644 --- a/pmocontrol/src/upnp_clients/openhome_client.rs +++ b/pmocontrol/src/upnp_clients/openhome_client.rs @@ -2,12 +2,11 @@ use crate::errors::ControlPointError; use crate::model::TrackMetadata; use crate::soap_client::{ decode_base64, ensure_success_with_envelope as ensure_success, extract_child_text, - extract_child_text_allow_empty, extract_child_text_any, extract_child_text_local, - extract_child_text_optional, extract_child_text_optional_local, find_child_with_suffix, - handle_action_response, + extract_child_text_any, extract_child_text_local, extract_child_text_optional, + extract_child_text_optional_local, find_child_with_suffix, handle_action_response, invoke_upnp_action, parse_bool, parse_visible_flag, }; -use anyhow::{Result, anyhow}; +use anyhow::{anyhow, Result}; use pmodidl::DIDLLite; use std::sync::{Arc, Mutex}; use std::time::{Duration, SystemTime}; @@ -419,7 +418,9 @@ impl OhPlaylistClient { // Log the raw IdArrayResponse XML for debugging { - let raw_children: Vec = response.children.iter() + let raw_children: Vec = response + .children + .iter() .map(|n: &xmltree::XMLNode| match n { xmltree::XMLNode::Element(e) => format!("{}={:?}", e.name, e.get_text()), _ => String::new(), @@ -767,7 +768,11 @@ impl SourceIndexCache { } fn get(&self) -> Option { - if self.is_valid() { self.index } else { None } + if self.is_valid() { + self.index + } else { + None + } } fn set(&mut self, index: u32) {