This commit is contained in:
Serial 2021-04-22 12:59:16 -04:00
parent dc23ec1ffd
commit 186d540d00
4 changed files with 10 additions and 11 deletions

View file

@ -1,5 +1,5 @@
use criterion::{criterion_group, criterion_main, Criterion};
use lofty::{DetermineFrom, Tag, TagType};
use lofty::{DetermineFrom, Tag};
macro_rules! test_read {
($function:ident, $path:expr) => {

View file

@ -16,7 +16,11 @@ use std::path::Path;
#[cfg(feature = "duration")]
use std::time::Duration;
impl_tag!(Id3v2Tag, Id3v2InnerTag, TagType::Id3v2(ID3Underlying::Default));
impl_tag!(
Id3v2Tag,
Id3v2InnerTag,
TagType::Id3v2(ID3Underlying::Default)
);
impl Id3v2Tag {
#[allow(clippy::missing_errors_doc)]
@ -40,7 +44,6 @@ impl Id3v2Tag {
#[cfg(feature = "duration")]
duration: None, // TODO
}),
_ => unreachable!(),
};
}
}
@ -212,12 +215,8 @@ impl AudioTagWrite for Id3v2Tag {
let id = &std::fs::read(&path)?[0..4];
match id {
b"RIFF" => self
.inner
.write_to_wav(path, id3::Version::Id3v24)?,
b"FORM" => self
.inner
.write_to_aiff(path, id3::Version::Id3v24)?,
b"RIFF" => self.inner.write_to_wav(path, id3::Version::Id3v24)?,
b"FORM" => self.inner.write_to_aiff(path, id3::Version::Id3v24)?,
_ => self.inner.write_to_path(path, id3::Version::Id3v24)?,
}

View file

@ -174,7 +174,7 @@ impl TagType {
73 if data.starts_with(&ID3) => Ok(Self::Id3v2(ID3Underlying::Default)),
#[cfg(feature = "id3")]
70 if data.starts_with(&FORM) => {
use byteorder::{LittleEndian, BigEndian, ReadBytesExt};
use byteorder::{BigEndian, LittleEndian, ReadBytesExt};
use std::io::{Cursor, SeekFrom};
let mut data = Cursor::new(data);

View file

@ -1,4 +1,4 @@
use lofty::{DetermineFrom, Tag, TagType, ToAnyTag, VorbisTag, ID3Underlying};
use lofty::{DetermineFrom, ID3Underlying, Tag, TagType, ToAnyTag, VorbisTag};
#[test]
#[cfg(all(feature = "id3", feature = "flac"))]