Error return adjustment

This commit is contained in:
2025-06-20 20:35:18 -04:00
parent 31838794b1
commit 474dde4445

View File

@@ -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;