TaggedFile: Add temporary fix for save_to breakage due to tag order

Depending on the order of the tags in a `TaggedFile`, since we write the tags independently of each other, they could step on each other's toes and leave the file in position where it cannot be probed. This wouldn't break the file, nor cause partial writes of tags, however there is a chance not *all* of the tags stored in the `TaggedFile` would be written.
This commit is contained in:
Serial 2022-12-10 12:13:44 -05:00 committed by Alex
parent c5bddba0cf
commit 42761e6bad

View file

@ -487,6 +487,9 @@ impl TaggedFileExt for TaggedFile {
fn save_to(&self, file: &mut File) -> Result<()> {
for tag in &self.tags {
// TODO: This is a temporary solution. Ideally we should probe once and use
// the format-specific writing to avoid these rewinds.
file.rewind()?;
tag.save_to(file)?;
}