Merge pull request #19 from arabianq/fix-unsafe-unwrap-on-file-path-conversion-in-cli-6901726970689342812

🧹 Fix unsafe unwrap on file path conversion in CLI and GUI
This commit is contained in:
Tarasov Aleksandr
2026-03-06 22:59:13 +03:00
committed by GitHub
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -144,7 +144,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
Actions::Play { Actions::Play {
file_path, file_path,
concurrent, concurrent,
} => Request::play(file_path.to_str().unwrap(), concurrent), } => Request::play(&file_path.to_string_lossy(), concurrent),
Actions::ToggleLoop { id } => Request::toggle_loop(id), Actions::ToggleLoop { id } => Request::toggle_loop(id),
}, },
Commands::Get { parameter } => match parameter { Commands::Get { parameter } => match parameter {
+1 -1
View File
@@ -113,7 +113,7 @@ impl SoundpadGui {
} }
pub fn play_file(&mut self, path: &PathBuf, concurrent: bool) { pub fn play_file(&mut self, path: &PathBuf, concurrent: bool) {
make_request_async(Request::play(path.to_str().unwrap(), concurrent)); make_request_async(Request::play(&path.to_string_lossy(), concurrent));
} }
pub fn set_input(&mut self, name: String) { pub fn set_input(&mut self, name: String) {