Skip to content

Commit 7575b71

Browse files
committed
docs: Remove references to ItemKey::Unknown
1 parent 49538f1 commit 7575b71

File tree

5 files changed

+12
-23
lines changed

5 files changed

+12
-23
lines changed

doc/NEW_TAG.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -351,12 +351,9 @@ impl SplitTag for FooTag {
351351
Now callers can split their `FooTag` into a generic `Tag`, but we'll need a way to merge them back together.
352352
This is done with the `MergeTag` trait.
353353

354-
When implementing `MergeTag`, one must take two things into consideration:
355-
356-
* The distinction between `ItemValue::Text` and `ItemValue::Locator` in certain formats
354+
When implementing `MergeTag`, one may need to take the distinction between `ItemValue::Text` and `ItemValue::Locator` into consideration.
357355
* In ID3v2 for example, a locator is only valid for frames starting with W.
358356
* In a format such as VorbisComments, there is no need to distinguish between the two.
359-
* The presence of `ItemKey::Unknown`
360357

361358
With that in mind, we'll now implement `MergeTag` on `SplitTagRemainder`:
362359

lofty/src/id3/v2/tag.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,18 +88,18 @@ macro_rules! impl_accessor {
8888
///
8989
/// When converting from a [`Tag`] to an `Id3v2Tag`, some frames may need editing.
9090
///
91-
/// * [`ItemKey::Comment`] and [`ItemKey::Lyrics`] - Unlike a normal text frame, these require a language. See [`CommentFrame`] and [`UnsynchronizedTextFrame`] respectively.
92-
/// An attempt is made to create this information, but it may be incorrect.
93-
/// * `language` - Unknown and set to "XXX"
94-
/// * `description` - Left empty, which is invalid if there are more than one of these frames. These frames can only be identified
91+
/// * [`ItemKey::Comment`] and [`ItemKey::Lyrics`] - Unlike a normal text frame, these require a language and description.
92+
/// * If these values aren't specified in the [`TagItem`], it will be filled in with (possibly incorrect) defaults.
93+
/// * `language` - Unknown and set to "XXX"
94+
/// * `description` - Left empty, which is invalid if there are more than one of these frames. These frames can only be identified
9595
/// by their descriptions, and as such they are expected to be unique for each.
96-
/// * [`ItemKey::Unknown("WXXX" | "TXXX")`](ItemKey::Unknown) - These frames are also identified by their descriptions.
96+
/// * See [`CommentFrame`] and [`UnsynchronizedTextFrame`] respectively.
9797
///
9898
/// ### To `Tag`
9999
///
100-
/// * TXXX/WXXX - These frames will be stored as an [`ItemKey`] by their description. Some variants exist for these descriptions, such as the one for `ReplayGain`,
101-
/// otherwise [`ItemKey::Unknown`] will be used.
102-
/// * Frames that require a language (COMM/USLT) - With ID3v2 being the only format that allows for language-specific items, this information is not retained.
100+
/// * TXXX/WXXX - These frames will be stored as an [`ItemKey`] by their description. Some variants exist
101+
/// for these descriptions, such as [`ItemKey::ReplayGainAlbumGain`]. Anything without a mapping will
102+
/// be discarded.
103103
/// * POPM - These frames will be stored as a raw [`ItemValue::Binary`] value under the [`ItemKey::Popularimeter`] key.
104104
///
105105
/// ## Special Frames

lofty/src/iff/wav/tag/mod.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,11 @@ macro_rules! impl_accessor {
3737
///
3838
/// ### To `Tag`
3939
///
40-
/// All items will be converted to a [`TagItem`], with all unknown keys being stored with [`ItemKey::Unknown`].
40+
/// All items without an [`ItemKey`] mapping will be discarded.
4141
///
4242
/// ### From `Tag`
4343
///
44-
/// When converting a [`TagItem`], two conditions must be met:
45-
///
46-
/// * The [`TagItem`] has a value other than [`ItemValue::Binary`](crate::ItemValue::Binary)
47-
/// * It has a key that is 4 bytes in length and within the ASCII range
44+
/// When converting a [`TagItem`], it must have a value other than [`ItemValue::Binary`](crate::ItemValue::Binary)
4845
#[derive(Default, Debug, PartialEq, Eq, Clone)]
4946
#[tag(description = "A RIFF INFO LIST", supported_formats(Wav))]
5047
pub struct RiffInfoList {

lofty/src/ogg/tag.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@ macro_rules! impl_accessor {
5252
/// If a [`TagItem`] with the key [`ItemKey::EncoderSoftware`] is available, it will be taken and
5353
/// used for the vendor string.
5454
///
55-
/// [`TagItem`]s with [`ItemKey::Unknown`] will have their keys verified for spec compliance. They must fall within
56-
/// ASCII range `0x20` through `0x7D`, excluding `0x3D` ('=').
57-
///
5855
/// When converting [Picture]s, they will first be passed through [`PictureInformation::from_picture`].
5956
/// If the information is available, it will be used. Otherwise, the picture will be stored with zeroed out
6057
/// [`PictureInformation`].

lofty/src/tag/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -363,8 +363,6 @@ impl Tag {
363363
///
364364
/// * This **will not** verify an [`ItemKey`] mapping exists
365365
/// * This **will not** allow writing item keys that are out of spec (keys are verified before writing)
366-
///
367-
/// This is only necessary if dealing with [`ItemKey::Unknown`].
368366
pub fn insert_unchecked(&mut self, item: TagItem) {
369367
self.retain(|i| i.item_key != item.item_key);
370368
self.items.push(item);
@@ -391,7 +389,7 @@ impl Tag {
391389

392390
/// Append a [`TagItem`] to the tag
393391
///
394-
/// Notes: See [`Tag::insert_unchecked`]
392+
/// Notes: See [`Tag::push()`] and the notes of [`Tag::insert_unchecked()`]
395393
pub fn push_unchecked(&mut self, item: TagItem) {
396394
self.items.push(item);
397395
}

0 commit comments

Comments
 (0)