From f7ab03ce47e1a45dd666f429b570f2d161d41457 Mon Sep 17 00:00:00 2001 From: Serial <69764315+Serial-ATA@users.noreply.github.com> Date: Wed, 22 Dec 2021 10:06:22 -0500 Subject: [PATCH] Fix privacy issue --- src/id3/v2/flags.rs | 2 +- src/id3/v2/items/mod.rs | 2 -- src/id3/v2/mod.rs | 15 ++++++++------- src/id3/v2/{items => }/restrictions.rs | 1 + 4 files changed, 10 insertions(+), 10 deletions(-) rename src/id3/v2/{items => }/restrictions.rs (99%) diff --git a/src/id3/v2/flags.rs b/src/id3/v2/flags.rs index 3f364613..4c8917db 100644 --- a/src/id3/v2/flags.rs +++ b/src/id3/v2/flags.rs @@ -1,5 +1,5 @@ #[cfg(feature = "id3v2_restrictions")] -use super::items::restrictions::TagRestrictions; +use super::restrictions::TagRestrictions; #[derive(Default, Copy, Clone, Debug, PartialEq)] #[allow(clippy::struct_excessive_bools)] diff --git a/src/id3/v2/items/mod.rs b/src/id3/v2/items/mod.rs index 9cbf11b0..d02ccdb9 100644 --- a/src/id3/v2/items/mod.rs +++ b/src/id3/v2/items/mod.rs @@ -1,4 +1,2 @@ pub(super) mod encapsulated_object; -#[cfg(feature = "id3v2_restrictions")] -pub(super) mod restrictions; pub(super) mod sync_text; diff --git a/src/id3/v2/mod.rs b/src/id3/v2/mod.rs index 86a2dc9b..ef4922fb 100644 --- a/src/id3/v2/mod.rs +++ b/src/id3/v2/mod.rs @@ -13,12 +13,16 @@ mod frame; mod items; #[cfg(feature = "id3v2")] pub(crate) mod read; +#[cfg(feature = "id3v2_restrictions")] +mod restrictions; #[cfg(feature = "id3v2")] pub(crate) mod tag; pub(crate) mod util; #[cfg(feature = "id3v2")] pub(crate) mod write; +#[cfg(feature = "id3v2")] +pub use flags::Id3v2TagFlags; #[cfg(feature = "id3v2")] pub use frame::{EncodedTextFrame, Frame, FrameFlags, FrameID, FrameValue, LanguageFrame}; #[cfg(feature = "id3v2")] @@ -26,23 +30,20 @@ pub use items::{ encapsulated_object::{GEOBInformation, GeneralEncapsulatedObject}, sync_text::{SyncTextContentType, SyncTextInformation, SynchronizedText, TimestampFormat}, }; +#[cfg(feature = "id3v2_restrictions")] +pub use restrictions::{ + ImageSizeRestrictions, TagRestrictions, TagSizeRestrictions, TextSizeRestrictions, +}; #[cfg(feature = "id3v2")] pub use tag::Id3v2Tag; pub use util::text_utils::TextEncoding; #[cfg(feature = "id3v2")] pub use util::upgrade::{upgrade_v2, upgrade_v3}; -#[cfg(feature = "id3v2")] -pub use flags::Id3v2TagFlags; #[cfg(not(feature = "id3v2"))] use flags::Id3v2TagFlags; -#[cfg(feature = "id3v2_restrictions")] -pub use crate::id3::v2::items::restrictions::*; - use crate::error::{LoftyError, Result}; -#[cfg(feature = "id3v2_restrictions")] -use crate::id3::v2::items::restrictions::TagRestrictions; use std::io::Read; diff --git a/src/id3/v2/items/restrictions.rs b/src/id3/v2/restrictions.rs similarity index 99% rename from src/id3/v2/items/restrictions.rs rename to src/id3/v2/restrictions.rs index 1b80249c..493d13c3 100644 --- a/src/id3/v2/items/restrictions.rs +++ b/src/id3/v2/restrictions.rs @@ -134,6 +134,7 @@ impl TagRestrictions { restrictions } + #[allow(clippy::trivially_copy_pass_by_ref)] /// Convert a [`TagRestrictions`] into a `u8` pub fn as_bytes(&self) -> u8 { let mut byte = 0;