From 474dde4445ad973529b485454f5aa333a968d5f5 Mon Sep 17 00:00:00 2001 From: phoenix Date: Fri, 20 Jun 2025 20:35:18 -0400 Subject: [PATCH] Error return adjustment --- src/meta.rs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/meta.rs b/src/meta.rs index 1687ab8..bab9b3a 100644 --- a/src/meta.rs +++ b/src/meta.rs @@ -220,9 +220,15 @@ pub mod metadata { } }; - vb.save_to_path(filepath, lofty::config::WriteOptions::default()); - - Ok(value.to_owned()) + match vb.save_to_path(filepath, lofty::config::WriteOptions::default()) { + Ok(res) => { + println!("Result: {:?}", res); + Ok(value.to_owned()) + } + Err(err) => { + Err(std::io::Error::new(std::io::ErrorKind::InvalidData, err.to_string())) + } + } } None => Err(std::io::Error::new( std::io::ErrorKind::InvalidData, @@ -582,8 +588,7 @@ mod tests { let dir = String::from(util::TESTFILEDIRECTORY); let temp_file = tempfile::tempdir().expect("Could not create test directory"); - let mut test_dir = String::from(temp_file.path().to_str().unwrap()); - test_dir = String::from("/home/phoenix/tmp/songparser/mydata"); + let test_dir = String::from(temp_file.path().to_str().unwrap()); let test_filename = String::from("track08.flac"); let new_filepath = test_dir + "/" + &test_filename;