doc: Fix a bunch more test imports

This commit is contained in:
Serial 2024-04-13 14:09:51 -04:00 committed by Alex
parent cf778c1f58
commit ca8a3cb5b9
14 changed files with 55 additions and 45 deletions

View file

@ -89,7 +89,7 @@ impl ApeTag {
///
/// ```rust
/// use lofty::ape::ApeTag;
/// use lofty::TagExt;
/// use lofty::tag::TagExt;
///
/// let ape_tag = ApeTag::new();
/// assert!(ape_tag.is_empty());

View file

@ -73,7 +73,7 @@ impl WriteOptions {
/// ```rust,no_run
/// use lofty::config::WriteOptions;
/// use lofty::prelude::*;
/// use lofty::{Tag, TagType};
/// use lofty::tag::{Tag, TagType};
///
/// # fn main() -> lofty::error::Result<()> {
/// let mut id3v2_tag = Tag::new(TagType::Id3v2);
@ -103,7 +103,7 @@ impl WriteOptions {
/// ```rust,no_run
/// use lofty::config::WriteOptions;
/// use lofty::prelude::*;
/// use lofty::{Tag, TagType};
/// use lofty::tag::{Tag, TagType};
///
/// # fn main() -> lofty::error::Result<()> {
/// let mut id3v2_tag = Tag::new(TagType::Id3v2);
@ -133,7 +133,7 @@ impl WriteOptions {
/// ```rust,no_run
/// use lofty::config::WriteOptions;
/// use lofty::prelude::*;
/// use lofty::{Tag, TagType};
/// use lofty::tag::{Tag, TagType};
///
/// # fn main() -> lofty::error::Result<()> {
/// let mut id3v2_tag = Tag::new(TagType::Id3v2);

View file

@ -43,7 +43,7 @@ impl FileType {
///
/// ```rust
/// use lofty::file::FileType;
/// use lofty::TagType;
/// use lofty::tag::TagType;
///
/// let file_type = FileType::Mpeg;
/// assert_eq!(file_type.primary_tag_type(), TagType::Id3v2);
@ -77,7 +77,7 @@ impl FileType {
///
/// ```rust
/// use lofty::file::FileType;
/// use lofty::TagType;
/// use lofty::tag::TagType;
///
/// let file_type = FileType::Mpeg;
/// assert!(file_type.supports_tag_type(TagType::Id3v2));

View file

@ -53,7 +53,7 @@ pub trait TaggedFileExt {
///
/// ```rust
/// use lofty::file::TaggedFileExt;
/// use lofty::TagType;
/// use lofty::tag::TagType;
///
/// # fn main() -> lofty::error::Result<()> {
/// # let path_to_mp3 = "tests/files/assets/minimal/full_test.mp3";
@ -72,7 +72,7 @@ pub trait TaggedFileExt {
///
/// ```rust
/// use lofty::file::TaggedFileExt;
/// use lofty::TagType;
/// use lofty::tag::TagType;
///
/// # fn main() -> lofty::error::Result<()> {
/// # let path_to_mp3 = "tests/files/assets/minimal/full_test.mp3";
@ -91,7 +91,7 @@ pub trait TaggedFileExt {
///
/// ```rust
/// use lofty::file::TaggedFileExt;
/// use lofty::TagType;
/// use lofty::tag::TagType;
///
/// # fn main() -> lofty::error::Result<()> {
/// # let path_to_mp3 = "tests/files/assets/minimal/full_test.mp3";
@ -113,7 +113,7 @@ pub trait TaggedFileExt {
///
/// ```rust
/// use lofty::file::TaggedFileExt;
/// use lofty::TagType;
/// use lofty::tag::TagType;
///
/// # fn main() -> lofty::error::Result<()> {
/// # let path_to_mp3 = "tests/files/assets/minimal/full_test.mp3";
@ -139,7 +139,7 @@ pub trait TaggedFileExt {
///
/// ```rust
/// use lofty::file::TaggedFileExt;
/// use lofty::TagType;
/// use lofty::tag::TagType;
///
/// # fn main() -> lofty::error::Result<()> {
/// # let path_to_mp3 = "tests/files/assets/minimal/full_test.mp3";
@ -165,7 +165,7 @@ pub trait TaggedFileExt {
///
/// ```rust
/// use lofty::file::TaggedFileExt;
/// use lofty::TagType;
/// use lofty::tag::TagType;
///
/// # fn main() -> lofty::error::Result<()> {
/// # let path_to_mp3 = "tests/files/assets/minimal/full_test.mp3";
@ -244,7 +244,7 @@ pub trait TaggedFileExt {
///
/// ```rust
/// use lofty::file::{AudioFile, TaggedFileExt};
/// use lofty::{Tag, TagType};
/// use lofty::tag::{Tag, TagType};
///
/// # fn main() -> lofty::error::Result<()> {
/// # let path_to_mp3 = "tests/files/assets/minimal/full_test.mp3";
@ -269,7 +269,7 @@ pub trait TaggedFileExt {
///
/// ```rust
/// use lofty::file::{AudioFile, TaggedFileExt};
/// use lofty::TagType;
/// use lofty::tag::TagType;
///
/// # fn main() -> lofty::error::Result<()> {
/// # let path_to_mp3 = "tests/files/assets/minimal/full_test.mp3";
@ -340,7 +340,7 @@ impl TaggedFile {
///
/// ```rust
/// use lofty::file::{AudioFile, FileType, TaggedFileExt};
/// use lofty::TagType;
/// use lofty::tag::TagType;
///
/// # fn main() -> lofty::error::Result<()> {
/// # let path_to_mp3 = "tests/files/assets/minimal/full_test.mp3";
@ -461,7 +461,7 @@ impl From<BoundTaggedFile> for TaggedFile {
/// ```rust,no_run
/// use lofty::config::WriteOptions;
/// use lofty::file::{AudioFile, TaggedFileExt};
/// use lofty::{Tag, TagType};
/// use lofty::tag::{Tag, TagType};
/// # fn main() -> lofty::error::Result<()> {
/// # let path = "tests/files/assets/minimal/full_test.mp3";
///
@ -486,7 +486,7 @@ impl From<BoundTaggedFile> for TaggedFile {
/// ```rust,no_run
/// use lofty::config::{ParseOptions, WriteOptions};
/// use lofty::file::{AudioFile, BoundTaggedFile, TaggedFileExt};
/// use lofty::{Tag, TagType};
/// use lofty::tag::{Tag, TagType};
/// use std::fs::OpenOptions;
/// # fn main() -> lofty::error::Result<()> {
/// # let path = "tests/files/assets/minimal/full_test.mp3";
@ -526,7 +526,7 @@ impl BoundTaggedFile {
/// ```rust
/// use lofty::config::ParseOptions;
/// use lofty::file::{AudioFile, BoundTaggedFile, TaggedFileExt};
/// use lofty::{Tag, TagType};
/// use lofty::tag::{Tag, TagType};
/// use std::fs::OpenOptions;
/// # fn main() -> lofty::error::Result<()> {
/// # let path = "tests/files/assets/minimal/full_test.mp3";
@ -559,7 +559,7 @@ impl BoundTaggedFile {
/// ```rust,no_run
/// use lofty::config::{ParseOptions, WriteOptions};
/// use lofty::file::{AudioFile, BoundTaggedFile, TaggedFileExt};
/// use lofty::{Tag, TagType};
/// use lofty::tag::{Tag, TagType};
/// use std::fs::OpenOptions;
/// # fn main() -> lofty::error::Result<()> {
/// # let path = "tests/files/assets/minimal/full_test.mp3";

View file

@ -114,7 +114,7 @@ impl Id3v1Tag {
///
/// ```rust
/// use lofty::id3::v1::Id3v1Tag;
/// use lofty::TagExt;
/// use lofty::tag::TagExt;
///
/// let id3v1_tag = Id3v1Tag::new();
/// assert!(id3v1_tag.is_empty());

View file

@ -154,7 +154,7 @@ impl Id3v2Tag {
///
/// ```rust
/// use lofty::id3::v2::Id3v2Tag;
/// use lofty::TagExt;
/// use lofty::tag::TagExt;
///
/// let id3v2_tag = Id3v2Tag::new();
/// assert!(id3v2_tag.is_empty());
@ -313,7 +313,7 @@ impl Id3v2Tag {
///
/// ```rust
/// use lofty::id3::v2::Id3v2Tag;
/// use lofty::TagExt;
/// use lofty::tag::TagExt;
///
/// let mut tag = Id3v2Tag::new();
///
@ -375,7 +375,7 @@ impl Id3v2Tag {
///
/// ```rust
/// use lofty::id3::v2::Id3v2Tag;
/// use lofty::TagExt;
/// use lofty::tag::TagExt;
///
/// let mut tag = Id3v2Tag::new();
/// assert!(tag.is_empty());
@ -412,7 +412,8 @@ impl Id3v2Tag {
///
/// ```rust
/// use lofty::id3::v2::{Frame, FrameFlags, FrameId, Id3v2Tag, TextInformationFrame};
/// use lofty::{TagExt, TextEncoding};
/// use lofty::tag::TagExt;
/// use lofty::TextEncoding;
/// use std::borrow::Cow;
///
/// const MOOD_FRAME_ID: FrameId<'static> = FrameId::Valid(Cow::Borrowed("TMOO"));

View file

@ -128,7 +128,7 @@ impl AIFFTextChunks {
///
/// ```rust
/// use lofty::iff::aiff::AIFFTextChunks;
/// use lofty::TagExt;
/// use lofty::tag::TagExt;
///
/// let aiff_tag = AIFFTextChunks::new();
/// assert!(aiff_tag.is_empty());

View file

@ -59,7 +59,7 @@ impl RIFFInfoList {
///
/// ```rust
/// use lofty::iff::wav::RIFFInfoList;
/// use lofty::TagExt;
/// use lofty::tag::TagExt;
///
/// let riff_info_tag = RIFFInfoList::new();
/// assert!(riff_info_tag.is_empty());

View file

@ -76,7 +76,7 @@
//! use lofty::config::ParseOptions;
//! use lofty::file::AudioFile;
//! use lofty::mpeg::MpegFile;
//! use lofty::TagType;
//! use lofty::tag::TagType;
//! use std::fs::File;
//!
//! # let path = "tests/files/assets/minimal/full_test.mp3";

View file

@ -91,7 +91,7 @@ impl Ilst {
///
/// ```rust
/// use lofty::mp4::Ilst;
/// use lofty::TagExt;
/// use lofty::tag::TagExt;
///
/// let ilst_tag = Ilst::new();
/// assert!(ilst_tag.is_empty());
@ -249,7 +249,8 @@ impl Ilst {
///
/// ```rust
/// use lofty::mp4::Ilst;
/// use lofty::{MimeType, Picture, PictureType, TagExt};
/// use lofty::tag::TagExt;
/// use lofty::{MimeType, Picture, PictureType};
///
/// let mut ilst = Ilst::new();
///
@ -292,7 +293,8 @@ impl Ilst {
///
/// ```rust
/// use lofty::mp4::Ilst;
/// use lofty::{MimeType, Picture, PictureType, TagExt};
/// use lofty::tag::TagExt;
/// use lofty::{MimeType, Picture, PictureType};
///
/// let mut ilst = Ilst::new();
///

View file

@ -78,7 +78,7 @@ impl VorbisComments {
///
/// ```rust
/// use lofty::ogg::VorbisComments;
/// use lofty::TagExt;
/// use lofty::tag::TagExt;
///
/// let vorbis_comments_tag = VorbisComments::new();
/// assert!(vorbis_comments_tag.is_empty());
@ -143,7 +143,7 @@ impl VorbisComments {
///
/// ```rust
/// use lofty::ogg::VorbisComments;
/// use lofty::TagExt;
/// use lofty::tag::TagExt;
///
/// let mut vorbis_comments = VorbisComments::default();
///

View file

@ -64,7 +64,8 @@ macro_rules! impl_accessor {
/// Accessing common items
///
/// ```rust
/// use lofty::{Accessor, Tag, TagType};
/// use lofty::tag::{Tag, TagType};
/// use lofty::Accessor;
///
/// let tag = Tag::new(TagType::Id3v2);
///
@ -79,7 +80,7 @@ macro_rules! impl_accessor {
/// Getting an item of a known type
///
/// ```rust
/// use lofty::{ItemKey, Tag, TagType};
/// use lofty::tag::{ItemKey, Tag, TagType};
///
/// let tag = Tag::new(TagType::Id3v2);
///
@ -94,7 +95,7 @@ macro_rules! impl_accessor {
///
/// ```rust
/// use lofty::id3::v2::Id3v2Tag;
/// use lofty::{Tag, TagType};
/// use lofty::tag::{Tag, TagType};
///
/// // Converting between formats is as simple as an `into` call.
/// // However, such conversions can potentially be *very* lossy.
@ -458,7 +459,8 @@ impl Tag {
/// # Examples
///
/// ```rust
/// use lofty::{Picture, Tag, TagType};
/// use lofty::tag::{Tag, TagType};
/// use lofty::Picture;
/// # use lofty::{PictureType, MimeType};
///
/// # let front_cover = Picture::new_unchecked(PictureType::CoverFront, Some(MimeType::Png), None, Vec::new());
@ -500,7 +502,8 @@ impl Tag {
/// # Examples
///
/// ```rust
/// use lofty::{Picture, Tag, TagType};
/// use lofty::tag::{Tag, TagType};
/// use lofty::Picture;
/// # use lofty::{PictureType, MimeType};
///
/// # let picture = Picture::new_unchecked(PictureType::CoverFront, Some(MimeType::Png), None, Vec::new());

View file

@ -26,7 +26,8 @@ pub trait TagExt: Accessor + Into<Tag> + Sized {
/// # Example
///
/// ```rust
/// use lofty::{Accessor, ItemKey, Tag, TagExt};
/// use lofty::tag::{ItemKey, Tag, TagExt};
/// use lofty::Accessor;
/// # let tag_type = lofty::TagType::Id3v2;
///
/// let mut tag = Tag::new(tag_type);
@ -42,7 +43,8 @@ pub trait TagExt: Accessor + Into<Tag> + Sized {
/// # Example
///
/// ```rust
/// use lofty::{Accessor, ItemKey, Tag, TagExt};
/// use lofty::tag::{ItemKey, Tag, TagExt};
/// use lofty::Accessor;
/// # let tag_type = lofty::TagType::Id3v2;
///
/// let mut tag = Tag::new(tag_type);
@ -58,8 +60,9 @@ pub trait TagExt: Accessor + Into<Tag> + Sized {
/// # Example
///
/// ```rust
/// use lofty::{Accessor, Tag, TagExt};
/// # let tag_type = lofty::TagType::Id3v2;
/// use lofty::tag::{Tag, TagExt};
/// use lofty::Accessor;
/// # let tag_type = lofty::tag::TagType::Id3v2;
///
/// let mut tag = Tag::new(tag_type);
/// assert!(tag.is_empty());

View file

@ -128,13 +128,14 @@ use crate::tag::Tag;
/// # Example
///
/// ```rust,no_run
/// use lofty::config::{ParseOptions, WriteOptions};
/// use lofty::mpeg::MpegFile;
/// use lofty::{AudioFile, ItemKey, MergeTag as _, SplitTag as _, WriteOptions};
/// use lofty::prelude::*;
///
/// // Read the tag from a file
/// # fn main() -> lofty::Result<()> {
/// # fn main() -> lofty::error::Result<()> {
/// # let mut file = std::fs::OpenOptions::new().write(true).open("/path/to/file.mp3")?;
/// # let parse_options = lofty::ParseOptions::default();
/// # let parse_options = ParseOptions::default();
/// let mut mpeg_file = <MpegFile as AudioFile>::read_from(&mut file, parse_options)?;
/// let mut id3v2 = mpeg_file
/// .id3v2_mut()
@ -156,7 +157,7 @@ use crate::tag::Tag;
/// mpeg_file.set_id3v2(id3v2);
/// mpeg_file.save_to(&mut file, WriteOptions::default())?;
///
/// # Ok::<(), lofty::LoftyError>(()) }
/// # Ok(()) }
/// ```
pub trait SplitTag {
/// The remainder of the split operation that is not represented