From 61dcdb6e55bd0574509139c81a17245237a87792 Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 3 Feb 2023 19:01:03 +0100 Subject: [PATCH] fixed excluding logic - now it works --- src/file_sink.rs | 5 ++--- src/main.rs | 26 +++++++++++++++++++++++--- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/src/file_sink.rs b/src/file_sink.rs index 966694b..3253273 100644 --- a/src/file_sink.rs +++ b/src/file_sink.rs @@ -22,11 +22,10 @@ impl FileSink { } impl Open for FileSink { - // use the unwrap_or_else method instead of the if let statement to handle the absence of a path value fn open(path: Option, _audio_format: AudioFormat) -> Self { - let file = path.unwrap_or_else(|| panic!()); + let file_path = path.unwrap_or_else(|| panic!()); FileSink { - sink: file, + sink: file_path, content: Vec::new(), metadata: None } diff --git a/src/main.rs b/src/main.rs index 6e6b779..bda7df5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -96,8 +96,28 @@ async fn download_tracks(session: &Session, destination: PathBuf, tracks: Vec