fix clippy lints under rust 1.95 (#90)

This commit is contained in:
RiDDiX
2026-04-28 13:13:11 +02:00
committed by GitHub
parent bcf791d84c
commit a6d93ff528
3 changed files with 8 additions and 8 deletions
+4 -4
View File
@@ -10,7 +10,7 @@ use pwsp::types::socket::Request;
use pwsp::types::{audio_player::TrackInfo, gui::AppState}; use pwsp::types::{audio_player::TrackInfo, gui::AppState};
use pwsp::utils::gui::{format_time_pair, make_request_async}; use pwsp::utils::gui::{format_time_pair, make_request_async};
use std::{ use std::{
path::{Path, PathBuf}, path::Path,
time::Instant, time::Instant,
}; };
@@ -440,7 +440,7 @@ impl SoundpadGui {
) )
.default_open(true) .default_open(true)
.show(ui, |ui| { .show(ui, |ui| {
if let Some(act) = Self::draw_track_control(ui, &mut self.app_state, &track) { if let Some(act) = Self::draw_track_control(ui, &mut self.app_state, track) {
action = Some(act); action = Some(act);
} }
}); });
@@ -866,11 +866,11 @@ impl SoundpadGui {
}); });
} }
fn get_hotkey_badge(&self, path: &PathBuf) -> Option<String> { fn get_hotkey_badge(&self, path: &Path) -> Option<String> {
for slot in &self.app_state.hotkey_config.slots { for slot in &self.app_state.hotkey_config.slots {
if slot.action.name == "play" if slot.action.name == "play"
&& let Some(file_path_str) = slot.action.args.get("file_path") && let Some(file_path_str) = slot.action.args.get("file_path")
&& Path::new(file_path_str) == path.as_path() && Path::new(file_path_str) == path
{ {
if let Some(chord) = &slot.key_chord { if let Some(chord) = &slot.key_chord {
return Some(format!("[{}]", chord)); return Some(format!("[{}]", chord));
+2 -2
View File
@@ -21,7 +21,7 @@ use pwsp::{
use rfd::FileDialog; use rfd::FileDialog;
use std::{ use std::{
error::Error, error::Error,
path::PathBuf, path::{Path, PathBuf},
sync::{Arc, Mutex}, sync::{Arc, Mutex},
}; };
@@ -120,7 +120,7 @@ impl SoundpadGui {
} }
} }
pub fn play_file(&mut self, path: &PathBuf, concurrent: bool) { pub fn play_file(&mut self, path: &Path, concurrent: bool) {
make_request_async(Request::play(&path.to_string_lossy(), concurrent)); make_request_async(Request::play(&path.to_string_lossy(), concurrent));
} }
+2 -2
View File
@@ -229,8 +229,8 @@ pub async fn get_all_devices() -> Result<(Vec<AudioDevice>, Vec<AudioDevice>), B
let mut output_devices: Vec<AudioDevice> = let mut output_devices: Vec<AudioDevice> =
output_devices.values().cloned().collect(); output_devices.values().cloned().collect();
input_devices.sort_by(|a, b| a.id.cmp(&b.id)); input_devices.sort_by_key(|a| a.id);
output_devices.sort_by(|a, b| a.id.cmp(&b.id)); output_devices.sort_by_key(|a| a.id);
return Ok((input_devices, output_devices)); return Ok((input_devices, output_devices));
} }