🧹 Fix unsafe unwrap on file path conversion in CLI and GUI

Replaced `.to_str().unwrap()` with `.to_string_lossy()` when converting
`PathBuf` to `String` to prevent potential crashes if the path contains
invalid Unicode. This change improves the robustness of both the CLI
and GUI components when handling file paths.

- Modified `src/bin/cli.rs` to safely handle `file_path`.
- Modified `src/gui/mod.rs` to safely handle `path` in `play_file`.

Co-authored-by: arabianq <55220741+arabianq@users.noreply.github.com>
This commit is contained in:
google-labs-jules[bot]
2026-03-06 19:52:30 +00:00
parent 624310eae5
commit 47a7674c14
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 {
file_path,
concurrent,
} => Request::play(file_path.to_str().unwrap(), concurrent),
} => Request::play(&file_path.to_string_lossy(), concurrent),
Actions::ToggleLoop { id } => Request::toggle_loop(id),
},
Commands::Get { parameter } => match parameter {