diff --git a/benches/create_tag.rs b/benches/create_tag.rs index 7b601b1b..649b8171 100644 --- a/benches/create_tag.rs +++ b/benches/create_tag.rs @@ -1,6 +1,6 @@ use lofty::ape::ApeTag; use lofty::id3::v1::ID3v1Tag; -use lofty::id3::v2::ID3v2Tag; +use lofty::id3::v2::Id3v2Tag; use lofty::iff::aiff::AIFFTextChunks; use lofty::iff::wav::RIFFInfoList; use lofty::mp4::Ilst; @@ -36,7 +36,7 @@ fn bench_write(c: &mut Criterion) { [ ("AIFF Text Chunks", AIFFTextChunks), ("APEv2", ApeTag), - ("ID3v2", ID3v2Tag), + ("ID3v2", Id3v2Tag), ("ID3v1", ID3v1Tag), ("MP4 Ilst", Ilst), ("RIFF INFO", RIFFInfoList), diff --git a/examples/custom_resolver/src/main.rs b/examples/custom_resolver/src/main.rs index 69c7b660..bec12520 100644 --- a/examples/custom_resolver/src/main.rs +++ b/examples/custom_resolver/src/main.rs @@ -1,6 +1,6 @@ use lofty::ape::ApeTag; use lofty::error::Result as LoftyResult; -use lofty::id3::v2::ID3v2Tag; +use lofty::id3::v2::Id3v2Tag; use lofty::resolve::FileResolver; use lofty::{FileProperties, FileType, ParseOptions, TagType}; use lofty_attr::LoftyFile; @@ -26,7 +26,7 @@ struct MyFile { // Specify a tag type #[lofty(tag_type = "Id3v2")] // Let's say our file *always* has an ID3v2Tag present. - pub id3v2_tag: ID3v2Tag, + pub id3v2_tag: Id3v2Tag, // Our APE tag is optional in this format, so we wrap it in an `Option` #[lofty(tag_type = "Ape")] @@ -45,7 +45,7 @@ impl MyFile { // Your parsing logic... Ok(Self { - id3v2_tag: ID3v2Tag::default(), + id3v2_tag: Id3v2Tag::default(), ape_tag: None, properties: FileProperties::default(), }) diff --git a/src/aac/mod.rs b/src/aac/mod.rs index f45216bb..64be15fe 100644 --- a/src/aac/mod.rs +++ b/src/aac/mod.rs @@ -7,7 +7,7 @@ mod properties; mod read; use crate::id3::v1::tag::ID3v1Tag; -use crate::id3::v2::tag::ID3v2Tag; +use crate::id3::v2::tag::Id3v2Tag; use lofty_attr::LoftyFile; @@ -21,7 +21,7 @@ pub use properties::AACProperties; #[lofty(internal_write_module_do_not_use_anywhere_else)] pub struct AacFile { #[lofty(tag_type = "Id3v2")] - pub(crate) id3v2_tag: Option, + pub(crate) id3v2_tag: Option, #[lofty(tag_type = "Id3v1")] pub(crate) id3v1_tag: Option, pub(crate) properties: AACProperties, diff --git a/src/ape/mod.rs b/src/ape/mod.rs index a9de6178..8f582719 100644 --- a/src/ape/mod.rs +++ b/src/ape/mod.rs @@ -12,7 +12,7 @@ mod read; pub(crate) mod tag; use crate::id3::v1::tag::ID3v1Tag; -use crate::id3::v2::tag::ID3v2Tag; +use crate::id3::v2::tag::Id3v2Tag; use lofty_attr::LoftyFile; @@ -33,7 +33,7 @@ pub struct ApeFile { pub(crate) id3v1_tag: Option, /// An ID3v2 tag (Not officially supported) #[lofty(tag_type = "Id3v2")] - pub(crate) id3v2_tag: Option, + pub(crate) id3v2_tag: Option, /// An APEv1/v2 tag #[lofty(tag_type = "Ape")] pub(crate) ape_tag: Option, diff --git a/src/ape/read.rs b/src/ape/read.rs index 279c36e5..c634ed4a 100644 --- a/src/ape/read.rs +++ b/src/ape/read.rs @@ -6,7 +6,7 @@ use super::{ApeFile, ApeProperties}; use crate::error::Result; use crate::id3::v1::tag::ID3v1Tag; use crate::id3::v2::read::parse_id3v2; -use crate::id3::v2::tag::ID3v2Tag; +use crate::id3::v2::tag::Id3v2Tag; use crate::id3::{find_id3v1, find_id3v2, find_lyrics3v2, ID3FindResults}; use crate::macros::decode_err; use crate::probe::ParseOptions; @@ -24,7 +24,7 @@ where let mut stream_len = end - start; - let mut id3v2_tag: Option = None; + let mut id3v2_tag: Option = None; let mut id3v1_tag: Option = None; let mut ape_tag: Option = None; diff --git a/src/flac/mod.rs b/src/flac/mod.rs index c94f1829..500240ea 100644 --- a/src/flac/mod.rs +++ b/src/flac/mod.rs @@ -11,7 +11,7 @@ pub(crate) mod write; use crate::error::Result; use crate::file::{FileType, TaggedFile}; -use crate::id3::v2::tag::ID3v2Tag; +use crate::id3::v2::tag::Id3v2Tag; use crate::ogg::tag::VorbisCommentsRef; use crate::ogg::{OggPictureStorage, VorbisComments}; use crate::picture::{Picture, PictureInformation}; @@ -44,7 +44,7 @@ pub use properties::FlacProperties; pub struct FlacFile { /// An ID3v2 tag #[lofty(tag_type = "Id3v2")] - pub(crate) id3v2_tag: Option, + pub(crate) id3v2_tag: Option, /// The vorbis comments contained in the file #[lofty(tag_type = "VorbisComments")] pub(crate) vorbis_comments_tag: Option, diff --git a/src/id3/v2/mod.rs b/src/id3/v2/mod.rs index 55e012d9..4dfd3cc2 100644 --- a/src/id3/v2/mod.rs +++ b/src/id3/v2/mod.rs @@ -4,7 +4,7 @@ //! //! See: //! -//! * [`ID3v2Tag`] +//! * [`Id3v2Tag`] //! * [Frame] mod flags; @@ -29,7 +29,7 @@ use byteorder::{BigEndian, ByteOrder, ReadBytesExt}; pub use flags::ID3v2TagFlags; pub use util::upgrade::{upgrade_v2, upgrade_v3}; -pub use tag::ID3v2Tag; +pub use tag::Id3v2Tag; pub use items::*; diff --git a/src/id3/v2/read.rs b/src/id3/v2/read.rs index a070beb7..b0f55306 100644 --- a/src/id3/v2/read.rs +++ b/src/id3/v2/read.rs @@ -1,12 +1,12 @@ use super::frame::Frame; -use super::tag::ID3v2Tag; +use super::tag::Id3v2Tag; use super::ID3v2Header; use crate::error::Result; use crate::id3::v2::util::synchsafe::UnsynchronizedStream; use std::io::Read; -pub(crate) fn parse_id3v2(bytes: &mut R, header: ID3v2Header) -> Result +pub(crate) fn parse_id3v2(bytes: &mut R, header: ID3v2Header) -> Result where R: Read, { @@ -29,11 +29,11 @@ where Ok(ret) } -fn read_all_frames_into_tag(reader: &mut R, header: ID3v2Header) -> Result +fn read_all_frames_into_tag(reader: &mut R, header: ID3v2Header) -> Result where R: Read, { - let mut tag = ID3v2Tag::default(); + let mut tag = Id3v2Tag::default(); tag.original_version = header.version; tag.set_flags(header.flags); diff --git a/src/id3/v2/tag.rs b/src/id3/v2/tag.rs index cb9ba073..79fede34 100644 --- a/src/id3/v2/tag.rs +++ b/src/id3/v2/tag.rs @@ -98,13 +98,13 @@ macro_rules! impl_accessor { description = "An `ID3v2` tag", supported_formats(Aac, Aiff, Mpeg, Wav, read_only(Flac, Ape)) )] -pub struct ID3v2Tag { +pub struct Id3v2Tag { flags: ID3v2TagFlags, pub(super) original_version: ID3v2Version, pub(crate) frames: Vec>, } -impl IntoIterator for ID3v2Tag { +impl IntoIterator for Id3v2Tag { type Item = Frame<'static>; type IntoIter = std::vec::IntoIter; @@ -113,7 +113,7 @@ impl IntoIterator for ID3v2Tag { } } -impl<'a> IntoIterator for &'a ID3v2Tag { +impl<'a> IntoIterator for &'a Id3v2Tag { type Item = &'a Frame<'static>; type IntoIter = std::slice::Iter<'a, Frame<'static>>; @@ -122,7 +122,7 @@ impl<'a> IntoIterator for &'a ID3v2Tag { } } -impl Default for ID3v2Tag { +impl Default for Id3v2Tag { fn default() -> Self { Self { flags: ID3v2TagFlags::default(), @@ -132,16 +132,16 @@ impl Default for ID3v2Tag { } } -impl ID3v2Tag { +impl Id3v2Tag { /// Create a new empty `ID3v2Tag` /// /// # Examples /// /// ```rust - /// use lofty::id3::v2::ID3v2Tag; + /// use lofty::id3::v2::Id3v2Tag; /// use lofty::TagExt; /// - /// let id3v2_tag = ID3v2Tag::new(); + /// let id3v2_tag = Id3v2Tag::new(); /// assert!(id3v2_tag.is_empty()); /// ``` pub fn new() -> Self { @@ -167,7 +167,7 @@ impl ID3v2Tag { } } -impl ID3v2Tag { +impl Id3v2Tag { /// Gets a [`Frame`] from an id /// /// NOTE: This is *not* case-sensitive @@ -437,7 +437,7 @@ where } } -impl Accessor for ID3v2Tag { +impl Accessor for Id3v2Tag { impl_accessor!( title => "TIT2"; artist => "TPE1"; @@ -558,7 +558,7 @@ impl Accessor for ID3v2Tag { } } -impl TagExt for ID3v2Tag { +impl TagExt for Id3v2Tag { type Err = LoftyError; type RefKey<'a> = &'a FrameId<'a>; @@ -617,23 +617,23 @@ impl TagExt for ID3v2Tag { } #[derive(Debug, Clone, Default)] -pub struct SplitTagRemainder(ID3v2Tag); +pub struct SplitTagRemainder(Id3v2Tag); -impl From for ID3v2Tag { +impl From for Id3v2Tag { fn from(from: SplitTagRemainder) -> Self { from.0 } } impl Deref for SplitTagRemainder { - type Target = ID3v2Tag; + type Target = Id3v2Tag; fn deref(&self) -> &Self::Target { &self.0 } } -impl SplitTag for ID3v2Tag { +impl SplitTag for Id3v2Tag { type Remainder = SplitTagRemainder; fn split_tag(mut self) -> (Self::Remainder, Tag) { @@ -845,9 +845,9 @@ impl SplitTag for ID3v2Tag { } impl MergeTag for SplitTagRemainder { - type Merged = ID3v2Tag; + type Merged = Id3v2Tag; - fn merge_tag(self, mut tag: Tag) -> ID3v2Tag { + fn merge_tag(self, mut tag: Tag) -> Id3v2Tag { fn join_text_items<'a>( tag: &mut Tag, keys: impl IntoIterator, @@ -981,13 +981,13 @@ impl MergeTag for SplitTagRemainder { } } -impl From for Tag { - fn from(input: ID3v2Tag) -> Self { +impl From for Tag { + fn from(input: Id3v2Tag) -> Self { input.split_tag().1 } } -impl From for ID3v2Tag { +impl From for Id3v2Tag { fn from(input: Tag) -> Self { SplitTagRemainder::default().merge_tag(input) } @@ -1077,7 +1077,7 @@ mod tests { }; use crate::id3::v2::{ read_id3v2_header, AttachedPictureFrame, CommentFrame, ExtendedTextFrame, Frame, - FrameFlags, FrameId, FrameValue, ID3v2Tag, ID3v2Version, TextInformationFrame, + FrameFlags, FrameId, FrameValue, ID3v2Version, Id3v2Tag, TextInformationFrame, UrlLinkFrame, }; use crate::tag::utils::test_utils::read_path; @@ -1089,7 +1089,7 @@ mod tests { use super::{COMMENT_FRAME_ID, EMPTY_CONTENT_DESCRIPTOR}; - fn read_tag(path: &str) -> ID3v2Tag { + fn read_tag(path: &str) -> Id3v2Tag { let tag_bytes = crate::tag::utils::test_utils::read_path(path); let mut reader = std::io::Cursor::new(&tag_bytes[..]); @@ -1100,7 +1100,7 @@ mod tests { #[test] fn parse_id3v2() { - let mut expected_tag = ID3v2Tag::default(); + let mut expected_tag = Id3v2Tag::default(); let encoding = TextEncoding::Latin1; let flags = FrameFlags::default(); @@ -1254,7 +1254,7 @@ mod tests { counter: 65535, }; - let converted_tag: ID3v2Tag = tag.into(); + let converted_tag: Id3v2Tag = tag.into(); assert_eq!(converted_tag.frames.len(), 1); let actual_frame = converted_tag.frames.first().unwrap(); @@ -1274,7 +1274,7 @@ mod tests { #[test] fn fail_write_bad_frame() { - let mut tag = ID3v2Tag::default(); + let mut tag = Id3v2Tag::default(); tag.insert(Frame { id: FrameId::Valid(Cow::Borrowed("ABCD")), value: FrameValue::Url(UrlLinkFrame(String::from("FOO URL"))), @@ -1294,7 +1294,7 @@ mod tests { #[test] fn tag_to_id3v2() { - fn verify_frame(tag: &ID3v2Tag, id: &str, value: &str) { + fn verify_frame(tag: &Id3v2Tag, id: &str, value: &str) { let frame = tag.get(id); assert!(frame.is_some()); @@ -1312,7 +1312,7 @@ mod tests { let tag = crate::tag::utils::test_utils::create_tag(TagType::Id3v2); - let id3v2_tag: ID3v2Tag = tag.into(); + let id3v2_tag: Id3v2Tag = tag.into(); verify_frame(&id3v2_tag, "TIT2", "Foo title"); verify_frame(&id3v2_tag, "TPE1", "Bar artist"); @@ -1334,8 +1334,8 @@ mod tests { } #[allow(clippy::field_reassign_with_default)] - fn create_full_test_tag(version: ID3v2Version) -> ID3v2Tag { - let mut tag = ID3v2Tag::default(); + fn create_full_test_tag(version: ID3v2Version) -> Id3v2Tag { + let mut tag = Id3v2Tag::default(); tag.original_version = version; let encoding = TextEncoding::UTF16; @@ -1518,7 +1518,7 @@ mod tests { #[test] fn multi_value_frame_to_tag() { use crate::traits::Accessor; - let mut tag = ID3v2Tag::default(); + let mut tag = Id3v2Tag::default(); tag.set_artist(String::from("foo\0bar\0baz")); @@ -1545,7 +1545,7 @@ mod tests { ItemValue::Text(String::from("baz")), )); - let tag: ID3v2Tag = tag.into(); + let tag: Id3v2Tag = tag.into(); assert_eq!(tag.artist().as_deref(), Some("foo/bar/baz")) } @@ -1556,7 +1556,7 @@ mod tests { #[test] fn replaygain_tag_conversion() { - let mut tag = ID3v2Tag::default(); + let mut tag = Id3v2Tag::default(); tag.insert( Frame::new( "TXXX", @@ -1639,7 +1639,7 @@ mod tests { )); assert_eq!(20, tag.len()); - let id3v2 = ID3v2Tag::from(tag.clone()); + let id3v2 = Id3v2Tag::from(tag.clone()); let (split_remainder, split_tag) = id3v2.split_tag(); assert_eq!(0, split_remainder.0.len()); @@ -1651,7 +1651,7 @@ mod tests { #[test] fn comments() { - let mut tag = ID3v2Tag::default(); + let mut tag = Id3v2Tag::default(); let encoding = TextEncoding::Latin1; let flags = FrameFlags::default(); let custom_descriptor = "lofty-rs"; @@ -1720,7 +1720,7 @@ mod tests { ) .unwrap(); - let mut tag = ID3v2Tag::default(); + let mut tag = Id3v2Tag::default(); tag.insert(txxx_frame.clone()); tag.insert(wxxx_frame.clone()); @@ -1743,7 +1743,7 @@ mod tests { .zip(tag.items()) .all(|(expected, actual)| expected == actual)); - let tag: ID3v2Tag = tag.into(); + let tag: Id3v2Tag = tag.into(); assert_eq!(tag.frames.len(), 2); assert_eq!(&tag.frames, &[txxx_frame, wxxx_frame]) @@ -1751,7 +1751,7 @@ mod tests { #[test] fn user_defined_frames_conversion() { - let mut id3v2 = ID3v2Tag::default(); + let mut id3v2 = Id3v2Tag::default(); id3v2.insert( Frame::new( "TXXX", @@ -1805,7 +1805,7 @@ mod tests { #[test] fn set_track() { - let mut id3v2 = ID3v2Tag::default(); + let mut id3v2 = Id3v2Tag::default(); let track = 1; id3v2.set_track(track); @@ -1816,7 +1816,7 @@ mod tests { #[test] fn set_track_total() { - let mut id3v2 = ID3v2Tag::default(); + let mut id3v2 = Id3v2Tag::default(); let track_total = 2; id3v2.set_track_total(track_total); @@ -1827,7 +1827,7 @@ mod tests { #[test] fn set_track_and_track_total() { - let mut id3v2 = ID3v2Tag::default(); + let mut id3v2 = Id3v2Tag::default(); let track = 1; let track_total = 2; @@ -1840,7 +1840,7 @@ mod tests { #[test] fn set_track_total_and_track() { - let mut id3v2 = ID3v2Tag::default(); + let mut id3v2 = Id3v2Tag::default(); let track_total = 2; let track = 1; @@ -1853,7 +1853,7 @@ mod tests { #[test] fn set_disk() { - let mut id3v2 = ID3v2Tag::default(); + let mut id3v2 = Id3v2Tag::default(); let disk = 1; id3v2.set_disk(disk); @@ -1864,7 +1864,7 @@ mod tests { #[test] fn set_disk_total() { - let mut id3v2 = ID3v2Tag::default(); + let mut id3v2 = Id3v2Tag::default(); let disk_total = 2; id3v2.set_disk_total(disk_total); @@ -1875,7 +1875,7 @@ mod tests { #[test] fn set_disk_and_disk_total() { - let mut id3v2 = ID3v2Tag::default(); + let mut id3v2 = Id3v2Tag::default(); let disk = 1; let disk_total = 2; @@ -1888,7 +1888,7 @@ mod tests { #[test] fn set_disk_total_and_disk() { - let mut id3v2 = ID3v2Tag::default(); + let mut id3v2 = Id3v2Tag::default(); let disk_total = 2; let disk = 1; @@ -1911,7 +1911,7 @@ mod tests { ItemValue::Text(track_number.to_string()), )); - let tag: ID3v2Tag = tag.into(); + let tag: Id3v2Tag = tag.into(); assert_eq!(tag.track().unwrap(), track_number); assert!(tag.track_total().is_none()); @@ -1929,7 +1929,7 @@ mod tests { ItemValue::Text(track_total.to_string()), )); - let tag: ID3v2Tag = tag.into(); + let tag: Id3v2Tag = tag.into(); assert_eq!(tag.track().unwrap(), DEFAULT_NUMBER_IN_PAIR); assert_eq!(tag.track_total().unwrap(), track_total); @@ -1953,7 +1953,7 @@ mod tests { ItemValue::Text(track_total.to_string()), )); - let tag: ID3v2Tag = tag.into(); + let tag: Id3v2Tag = tag.into(); assert_eq!(tag.track().unwrap(), track_number); assert_eq!(tag.track_total().unwrap(), track_total); @@ -1971,7 +1971,7 @@ mod tests { ItemValue::Text(disk_number.to_string()), )); - let tag: ID3v2Tag = tag.into(); + let tag: Id3v2Tag = tag.into(); assert_eq!(tag.disk().unwrap(), disk_number); assert!(tag.disk_total().is_none()); @@ -1989,7 +1989,7 @@ mod tests { ItemValue::Text(disk_total.to_string()), )); - let tag: ID3v2Tag = tag.into(); + let tag: Id3v2Tag = tag.into(); assert_eq!(tag.disk().unwrap(), DEFAULT_NUMBER_IN_PAIR); assert_eq!(tag.disk_total().unwrap(), disk_total); @@ -2013,14 +2013,14 @@ mod tests { ItemValue::Text(disk_total.to_string()), )); - let tag: ID3v2Tag = tag.into(); + let tag: Id3v2Tag = tag.into(); assert_eq!(tag.disk().unwrap(), disk_number); assert_eq!(tag.disk_total().unwrap(), disk_total); } fn create_tag_with_trck_and_tpos_frame(content: &'static str) -> Tag { - fn insert_frame(id: &'static str, content: &'static str, tag: &mut ID3v2Tag) { + fn insert_frame(id: &'static str, content: &'static str, tag: &mut Id3v2Tag) { tag.insert(new_text_frame( FrameId::Valid(Cow::Borrowed(id)), content.to_string(), @@ -2028,7 +2028,7 @@ mod tests { )); } - let mut tag = ID3v2Tag::default(); + let mut tag = Id3v2Tag::default(); insert_frame("TRCK", content, &mut tag); insert_frame("TPOS", content, &mut tag); @@ -2080,7 +2080,7 @@ mod tests { #[test] fn ufid_frame_with_musicbrainz_record_id() { - let mut id3v2 = ID3v2Tag::default(); + let mut id3v2 = Id3v2Tag::default(); let unknown_ufid_frame = UniqueFileIdentifierFrame { owner: "other".to_owned(), identifier: b"0123456789".to_vec(), diff --git a/src/id3/v2/write/mod.rs b/src/id3/v2/write/mod.rs index ef364dab..f33d5460 100644 --- a/src/id3/v2/write/mod.rs +++ b/src/id3/v2/write/mod.rs @@ -8,7 +8,7 @@ use crate::id3::find_id3v2; use crate::id3::v2::frame::FrameRef; use crate::id3::v2::tag::Id3v2TagRef; use crate::id3::v2::util::synchsafe::SynchsafeInteger; -use crate::id3::v2::ID3v2Tag; +use crate::id3::v2::Id3v2Tag; use crate::macros::err; use crate::probe::Probe; @@ -49,13 +49,13 @@ pub(crate) fn write_id3v2<'a, I: Iterator> + Clone + 'a>( let file_type = file_type.unwrap(); - if !ID3v2Tag::SUPPORTED_FORMATS.contains(&file_type) { + if !Id3v2Tag::SUPPORTED_FORMATS.contains(&file_type) { err!(UnsupportedTag); } // Attempting to write a non-empty tag to a read only format // An empty tag implies the tag should be stripped. - if ID3v2Tag::READ_ONLY_FORMATS.contains(&file_type) { + if Id3v2Tag::READ_ONLY_FORMATS.contains(&file_type) { let mut peek = tag.frames.clone().peekable(); if peek.peek().is_some() { err!(UnsupportedTag); @@ -253,12 +253,12 @@ fn calculate_crc(content: &[u8]) -> [u8; 5] { #[cfg(test)] mod tests { - use crate::id3::v2::{ID3v2Tag, ID3v2TagFlags}; + use crate::id3::v2::{ID3v2TagFlags, Id3v2Tag}; use crate::{Accessor, TagExt}; #[test] fn id3v2_write_crc32() { - let mut tag = ID3v2Tag::default(); + let mut tag = Id3v2Tag::default(); tag.set_artist(String::from("Foo artist")); let flags = ID3v2TagFlags { diff --git a/src/iff/aiff/mod.rs b/src/iff/aiff/mod.rs index 8e9f1833..2665d7fe 100644 --- a/src/iff/aiff/mod.rs +++ b/src/iff/aiff/mod.rs @@ -4,7 +4,7 @@ mod properties; mod read; pub(crate) mod tag; -use crate::id3::v2::tag::ID3v2Tag; +use crate::id3::v2::tag::Id3v2Tag; use crate::properties::FileProperties; use lofty_attr::LoftyFile; @@ -23,7 +23,7 @@ pub struct AiffFile { pub(crate) text_chunks_tag: Option, /// An ID3v2 tag #[lofty(tag_type = "Id3v2")] - pub(crate) id3v2_tag: Option, + pub(crate) id3v2_tag: Option, /// The file's audio properties pub(crate) properties: FileProperties, } diff --git a/src/iff/aiff/read.rs b/src/iff/aiff/read.rs index cfc87a0d..cd0b6abf 100644 --- a/src/iff/aiff/read.rs +++ b/src/iff/aiff/read.rs @@ -1,7 +1,7 @@ use super::tag::{AIFFTextChunks, Comment}; use super::AiffFile; use crate::error::Result; -use crate::id3::v2::tag::ID3v2Tag; +use crate::id3::v2::tag::Id3v2Tag; use crate::iff::chunk::Chunks; use crate::macros::{decode_err, err}; use crate::probe::ParseOptions; @@ -45,7 +45,7 @@ where let mut annotations = Vec::new(); let mut comments = Vec::new(); - let mut id3v2_tag: Option = None; + let mut id3v2_tag: Option = None; let mut chunks = Chunks::::new(file_len); diff --git a/src/iff/chunk.rs b/src/iff/chunk.rs index 9f14a1d5..e8d9406a 100644 --- a/src/iff/chunk.rs +++ b/src/iff/chunk.rs @@ -1,5 +1,5 @@ use crate::error::Result; -use crate::id3::v2::tag::ID3v2Tag; +use crate::id3::v2::tag::Id3v2Tag; use crate::macros::{err, try_vec}; use std::io::{Read, Seek, SeekFrom}; @@ -91,7 +91,7 @@ impl Chunks { Ok(content) } - pub fn id3_chunk(&mut self, data: &mut R) -> Result + pub fn id3_chunk(&mut self, data: &mut R) -> Result where R: Read + Seek, { diff --git a/src/iff/wav/mod.rs b/src/iff/wav/mod.rs index 102b0f6b..78a6e635 100644 --- a/src/iff/wav/mod.rs +++ b/src/iff/wav/mod.rs @@ -4,7 +4,7 @@ mod properties; mod read; pub(crate) mod tag; -use crate::id3::v2::tag::ID3v2Tag; +use crate::id3::v2::tag::Id3v2Tag; use lofty_attr::LoftyFile; @@ -22,7 +22,7 @@ pub struct WavFile { pub(crate) riff_info_tag: Option, /// An ID3v2 tag #[lofty(tag_type = "Id3v2")] - pub(crate) id3v2_tag: Option, + pub(crate) id3v2_tag: Option, /// The file's audio properties pub(crate) properties: WavProperties, } diff --git a/src/iff/wav/read.rs b/src/iff/wav/read.rs index 85938177..34107f49 100644 --- a/src/iff/wav/read.rs +++ b/src/iff/wav/read.rs @@ -2,7 +2,7 @@ use super::properties::WavProperties; use super::tag::RIFFInfoList; use super::WavFile; use crate::error::Result; -use crate::id3::v2::tag::ID3v2Tag; +use crate::id3::v2::tag::Id3v2Tag; use crate::iff::chunk::Chunks; use crate::macros::decode_err; use crate::probe::ParseOptions; @@ -45,7 +45,7 @@ where let mut fmt = Vec::new(); let mut riff_info = RIFFInfoList::default(); - let mut id3v2_tag: Option = None; + let mut id3v2_tag: Option = None; let mut chunks = Chunks::::new(file_len); diff --git a/src/mpeg/mod.rs b/src/mpeg/mod.rs index 2e5beecc..8f639e22 100644 --- a/src/mpeg/mod.rs +++ b/src/mpeg/mod.rs @@ -9,7 +9,7 @@ pub use properties::MpegProperties; use crate::ape::tag::ApeTag; use crate::id3::v1::tag::ID3v1Tag; -use crate::id3::v2::tag::ID3v2Tag; +use crate::id3::v2::tag::Id3v2Tag; use lofty_attr::LoftyFile; @@ -20,7 +20,7 @@ use lofty_attr::LoftyFile; pub struct MpegFile { /// An ID3v2 tag #[lofty(tag_type = "Id3v2")] - pub(crate) id3v2_tag: Option, + pub(crate) id3v2_tag: Option, /// An ID3v1 tag #[lofty(tag_type = "Id3v1")] pub(crate) id3v1_tag: Option, diff --git a/src/resolve.rs b/src/resolve.rs index de2f1e56..3a5608d1 100644 --- a/src/resolve.rs +++ b/src/resolve.rs @@ -130,7 +130,7 @@ pub fn register_custom_resolver(name: &'static str) { #[cfg(test)] mod tests { use crate::file::{FileType, TaggedFileExt}; - use crate::id3::v2::ID3v2Tag; + use crate::id3::v2::Id3v2Tag; use crate::probe::ParseOptions; use crate::properties::FileProperties; use crate::resolve::{register_custom_resolver, FileResolver}; @@ -148,7 +148,7 @@ mod tests { #[lofty(file_type = "MyFile")] struct MyFile { #[lofty(tag_type = "Id3v2")] - id3v2_tag: Option, + id3v2_tag: Option, properties: FileProperties, } @@ -180,7 +180,7 @@ mod tests { _reader: &mut R, _parse_options: ParseOptions, ) -> crate::error::Result { - let mut tag = ID3v2Tag::default(); + let mut tag = Id3v2Tag::default(); tag.set_artist(String::from("All is well!")); Ok(Self { diff --git a/src/tag/mod.rs b/src/tag/mod.rs index 3a567eb4..ee501994 100644 --- a/src/tag/mod.rs +++ b/src/tag/mod.rs @@ -85,14 +85,14 @@ macro_rules! impl_accessor { /// Converting between formats /// /// ```rust -/// use lofty::id3::v2::ID3v2Tag; +/// use lofty::id3::v2::Id3v2Tag; /// use lofty::{Tag, TagType}; /// /// // Converting between formats is as simple as an `into` call. /// // However, such conversions can potentially be *very* lossy. /// /// let tag = Tag::new(TagType::Id3v2); -/// let id3v2_tag: ID3v2Tag = tag.into(); +/// let id3v2_tag: Id3v2Tag = tag.into(); /// ``` #[derive(Clone)] pub struct Tag { diff --git a/tests/files/ogg.rs b/tests/files/ogg.rs index 05102be7..9f855d0e 100644 --- a/tests/files/ogg.rs +++ b/tests/files/ogg.rs @@ -172,10 +172,10 @@ fn flac_remove_id3v2() { #[test] fn flac_try_write_non_empty_id3v2() { - use lofty::id3::v2::ID3v2Tag; + use lofty::id3::v2::Id3v2Tag; use lofty::Accessor; - let mut tag = ID3v2Tag::default(); + let mut tag = Id3v2Tag::default(); tag.set_artist(String::from("Foo artist")); assert!(tag diff --git a/tests/tags/conversions.rs b/tests/tags/conversions.rs index 5a1e411e..3d3386f7 100644 --- a/tests/tags/conversions.rs +++ b/tests/tags/conversions.rs @@ -1,6 +1,6 @@ // Tests for special case conversions -use lofty::id3::v2::{CommentFrame, Frame, FrameFlags, ID3v2Tag, UnsynchronizedTextFrame}; +use lofty::id3::v2::{CommentFrame, Frame, FrameFlags, Id3v2Tag, UnsynchronizedTextFrame}; use lofty::{ItemKey, Tag, TagType, TextEncoding}; #[test] @@ -9,7 +9,7 @@ fn tag_to_id3v2_lang_frame() { tag.insert_text(ItemKey::Lyrics, String::from("Test lyrics")); tag.insert_text(ItemKey::Comment, String::from("Test comment")); - let id3: ID3v2Tag = tag.into(); + let id3: Id3v2Tag = tag.into(); assert_eq!( id3.get("USLT"),