Error return adjustment
This commit is contained in:
15
src/meta.rs
15
src/meta.rs
@@ -220,9 +220,15 @@ pub mod metadata {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
vb.save_to_path(filepath, lofty::config::WriteOptions::default());
|
match vb.save_to_path(filepath, lofty::config::WriteOptions::default()) {
|
||||||
|
Ok(res) => {
|
||||||
Ok(value.to_owned())
|
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(
|
None => Err(std::io::Error::new(
|
||||||
std::io::ErrorKind::InvalidData,
|
std::io::ErrorKind::InvalidData,
|
||||||
@@ -582,8 +588,7 @@ mod tests {
|
|||||||
let dir = String::from(util::TESTFILEDIRECTORY);
|
let dir = String::from(util::TESTFILEDIRECTORY);
|
||||||
|
|
||||||
let temp_file = tempfile::tempdir().expect("Could not create test directory");
|
let temp_file = tempfile::tempdir().expect("Could not create test directory");
|
||||||
let mut test_dir = String::from(temp_file.path().to_str().unwrap());
|
let test_dir = String::from(temp_file.path().to_str().unwrap());
|
||||||
test_dir = String::from("/home/phoenix/tmp/songparser/mydata");
|
|
||||||
let test_filename = String::from("track08.flac");
|
let test_filename = String::from("track08.flac");
|
||||||
let new_filepath = test_dir + "/" + &test_filename;
|
let new_filepath = test_dir + "/" + &test_filename;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user