MPEG: Remove write module

This commit is contained in:
Serial 2022-09-29 18:11:24 -04:00
parent 0a628df62c
commit 8b8f355d89
No known key found for this signature in database
GPG key ID: DA95198DC17C4568
2 changed files with 1 additions and 34 deletions

View file

@ -3,7 +3,6 @@ mod constants;
pub(crate) mod header; pub(crate) mod header;
mod properties; mod properties;
mod read; mod read;
pub(crate) mod write;
pub use header::{ChannelMode, Emphasis, Layer, MpegVersion}; pub use header::{ChannelMode, Emphasis, Layer, MpegVersion};
pub use properties::MPEGProperties; pub use properties::MPEGProperties;
@ -20,6 +19,7 @@ use lofty_attr::LoftyFile;
/// An MPEG file /// An MPEG file
#[derive(LoftyFile, Default)] #[derive(LoftyFile, Default)]
#[lofty(read_fn = "read::read_from")] #[lofty(read_fn = "read::read_from")]
#[lofty(internal_write_module_do_not_use_anywhere_else)]
pub struct MPEGFile { pub struct MPEGFile {
/// An ID3v2 tag /// An ID3v2 tag
#[cfg(feature = "id3v2")] #[cfg(feature = "id3v2")]

View file

@ -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::<v1::tag::Id3v1TagRef<'_>>::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),
}
}