diff --git a/src/bin/cli.rs b/src/bin/cli.rs index 45fdc53..5ea8cea 100644 --- a/src/bin/cli.rs +++ b/src/bin/cli.rs @@ -144,7 +144,7 @@ async fn main() -> Result<(), Box> { 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 { diff --git a/src/gui/mod.rs b/src/gui/mod.rs index 5f37d16..9b09cbf 100644 --- a/src/gui/mod.rs +++ b/src/gui/mod.rs @@ -113,7 +113,7 @@ impl SoundpadGui { } 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) {