cargo clippy

This commit is contained in:
2025-09-13 18:27:22 +03:00
parent 06f12cd740
commit ac721d0c4d
2 changed files with 8 additions and 13 deletions
+5 -10
View File
@@ -14,16 +14,13 @@ pub use settings::Settings;
use std::{fs, path::PathBuf}; use std::{fs, path::PathBuf};
#[derive(PartialEq)] #[derive(PartialEq)]
#[derive(Default)]
enum PlayerState { enum PlayerState {
PLAYING, PLAYING,
#[default]
PAUSED, PAUSED,
} }
impl Default for PlayerState {
fn default() -> Self {
PlayerState::PAUSED
}
}
pub struct App { pub struct App {
saved_settings: Settings, saved_settings: Settings,
@@ -330,9 +327,9 @@ impl App {
continue; continue;
} }
if let Some(extension) = path.extension().and_then(|n| n.to_str()) { if let Some(extension) = path.extension().and_then(|n| n.to_str())
if music_extensions.contains(&extension.to_lowercase().as_str()) { && music_extensions.contains(&extension.to_lowercase().as_str())
if path && path
.to_str() .to_str()
.unwrap() .unwrap()
.to_string() .to_string()
@@ -342,8 +339,6 @@ impl App {
music_files.push(path); music_files.push(path);
} }
} }
}
}
ui.vertical(|ui| { ui.vertical(|ui| {
let search_entry = TextEdit::singleline(&mut self.search_query); let search_entry = TextEdit::singleline(&mut self.search_query);
ui.add_sized([ui.available_width(), 20.0], search_entry); ui.add_sized([ui.available_width(), 20.0], search_entry);
+3 -3
View File
@@ -53,7 +53,7 @@ impl OutputDevice {
fn get_pw_entries() -> Result<Vec<HashMap<String, String>>, Box<dyn Error>> { fn get_pw_entries() -> Result<Vec<HashMap<String, String>>, Box<dyn Error>> {
let output = Command::new("pw-cli") let output = Command::new("pw-cli")
.args(&["ls", "Node"]) .args(["ls", "Node"])
.output() .output()
.expect("Failed to execute pw-cli ls Node"); .expect("Failed to execute pw-cli ls Node");
@@ -123,7 +123,7 @@ pub fn get_input_devices() -> Result<Vec<InputDevice>, Box<dyn Error>> {
continue; continue;
} }
if !media_class.starts_with(&"Audio/Source") { if !media_class.starts_with("Audio/Source") {
continue; continue;
} }
@@ -191,7 +191,7 @@ pub fn get_output_devices() -> Result<Vec<OutputDevice>, Box<dyn Error>> {
continue; continue;
} }
if !media_class.starts_with(&"Stream/Output/Audio") { if !media_class.starts_with("Stream/Output/Audio") {
continue; continue;
} }