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