From 8b8f355d89f357eff3be1ccf3e2cedc98b10e434 Mon Sep 17 00:00:00 2001 From: Serial <69764315+Serial-ATA@users.noreply.github.com> Date: Thu, 29 Sep 2022 18:11:24 -0400 Subject: [PATCH] MPEG: Remove write module --- src/mpeg/mod.rs | 2 +- src/mpeg/write.rs | 33 --------------------------------- 2 files changed, 1 insertion(+), 34 deletions(-) delete mode 100644 src/mpeg/write.rs diff --git a/src/mpeg/mod.rs b/src/mpeg/mod.rs index b55c020a..3356eae9 100644 --- a/src/mpeg/mod.rs +++ b/src/mpeg/mod.rs @@ -3,7 +3,6 @@ mod constants; pub(crate) mod header; mod properties; mod read; -pub(crate) mod write; pub use header::{ChannelMode, Emphasis, Layer, MpegVersion}; pub use properties::MPEGProperties; @@ -20,6 +19,7 @@ use lofty_attr::LoftyFile; /// An MPEG file #[derive(LoftyFile, Default)] #[lofty(read_fn = "read::read_from")] +#[lofty(internal_write_module_do_not_use_anywhere_else)] pub struct MPEGFile { /// An ID3v2 tag #[cfg(feature = "id3v2")] diff --git a/src/mpeg/write.rs b/src/mpeg/write.rs deleted file mode 100644 index f3b1b369..00000000 --- a/src/mpeg/write.rs +++ /dev/null @@ -1,33 +0,0 @@ -#[cfg(feature = "ape")] -use crate::ape; -use crate::error::Result; -#[cfg(feature = "id3v1")] -use crate::id3::v1; -#[cfg(feature = "id3v2")] -use crate::id3::v2; -use crate::macros::err; -#[allow(unused_imports)] -use crate::tag::{Tag, TagType}; - -use std::fs::File; - -#[allow(unused_variables)] -pub(crate) fn write_to(data: &mut File, tag: &Tag) -> Result<()> { - match tag.tag_type() { - #[cfg(feature = "ape")] - TagType::APE => ape::tag::ApeTagRef { - read_only: false, - items: ape::tag::tagitems_into_ape(tag.items()), - } - .write_to(data), - #[cfg(feature = "id3v1")] - TagType::ID3v1 => Into::>::into(tag).write_to(data), - #[cfg(feature = "id3v2")] - TagType::ID3v2 => v2::tag::Id3v2TagRef { - flags: v2::ID3v2TagFlags::default(), - frames: v2::tag::tag_frames(tag), - } - .write_to(data), - _ => err!(UnsupportedTag), - } -}