@@ -31,7 +31,7 @@ macro_rules! impl_accessor {
3131 paste:: paste! {
3232 $(
3333 fn $method( & self ) -> Option <Cow <' _, str >> {
34- self . get_str( EbmlTagKey ( TargetType :: $target, Cow :: Borrowed ( $name) ) )
34+ self . get_str( MatroskaTagKey ( TargetType :: $target, Cow :: Borrowed ( $name) ) )
3535 }
3636
3737 fn [ <set_ $method>] ( & mut self , value: String ) {
@@ -57,18 +57,18 @@ macro_rules! impl_accessor {
5757/// * [`Target`]
5858/// * [`AttachedFile`]
5959#[ derive( Default , Debug , PartialEq , Eq , Clone ) ]
60- #[ tag( description = "An `EBML` \" tag\" " , supported_formats( Ebml ) ) ]
61- pub struct EbmlTag {
60+ #[ tag( description = "A Matroska/WebM \" tag\" " , supported_formats( Ebml ) ) ]
61+ pub struct MatroskaTag {
6262 pub ( crate ) tags : Vec < Tag < ' static > > ,
6363 pub ( crate ) attached_files : Vec < AttachedFile < ' static > > ,
6464}
6565
6666// TODO
6767#[ allow( missing_docs) ]
68- pub struct EbmlTagKey < ' a > ( TargetType , Cow < ' a , str > ) ;
68+ pub struct MatroskaTagKey < ' a > ( TargetType , Cow < ' a , str > ) ;
6969
70- impl EbmlTag {
71- fn get ( & self , key : EbmlTagKey < ' _ > ) -> Option < & SimpleTag < ' _ > > {
70+ impl MatroskaTag {
71+ fn get ( & self , key : MatroskaTagKey < ' _ > ) -> Option < & SimpleTag < ' _ > > {
7272 fn tag_matches_target ( tag : & Tag < ' _ > , target_type : TargetType ) -> bool {
7373 let Some ( target) = & tag. target else {
7474 // An empty target is implicitly `Album`
@@ -78,7 +78,7 @@ impl EbmlTag {
7878 target. is_candidate_for_type ( target_type)
7979 }
8080
81- let EbmlTagKey ( target, key) = key;
81+ let MatroskaTagKey ( target, key) = key;
8282
8383 let applicable_tags = self
8484 . tags
@@ -98,7 +98,7 @@ impl EbmlTag {
9898 None
9999 }
100100
101- fn get_str ( & self , key : EbmlTagKey < ' _ > ) -> Option < Cow < ' _ , str > > {
101+ fn get_str ( & self , key : MatroskaTagKey < ' _ > ) -> Option < Cow < ' _ , str > > {
102102 let simple_tag = self . get ( key) ?;
103103 simple_tag. get_str ( ) . map ( Cow :: from)
104104 }
@@ -131,11 +131,11 @@ impl EbmlTag {
131131 /// # Examples
132132 ///
133133 /// ```rust,no_run
134- /// use lofty::ebml::EbmlTag ;
134+ /// use lofty::ebml::MatroskaTag ;
135135 /// use lofty::picture::Picture;
136136 ///
137137 /// # fn main() -> lofty::error::Result<()> {
138- /// let mut tag = EbmlTag ::default();
138+ /// let mut tag = MatroskaTag ::default();
139139 ///
140140 /// let mut picture = std::fs::read("something.png")?;
141141 /// let mut picture2 = std::fs::read("something_else.png")?;
@@ -153,14 +153,14 @@ impl EbmlTag {
153153
154154 /// Inserts a new [`Picture`]
155155 ///
156- /// Note: See [`EbmlTag ::insert_attached_file`]
156+ /// Note: See [`MatroskaTag ::insert_attached_file`]
157157 ///
158158 /// ```rust,no_run
159- /// use lofty::ebml::EbmlTag ;
159+ /// use lofty::ebml::MatroskaTag ;
160160 /// use lofty::picture::Picture;
161161 ///
162162 /// # fn main() -> lofty::error::Result<()> {
163- /// let mut tag = EbmlTag ::default();
163+ /// let mut tag = MatroskaTag ::default();
164164 ///
165165 /// let mut picture_file = std::fs::read("something.png")?;
166166 /// tag.insert_picture(Picture::from_reader(&mut &picture_file[..])?);
@@ -219,7 +219,7 @@ impl EbmlTag {
219219 }
220220}
221221
222- impl Accessor for EbmlTag {
222+ impl Accessor for MatroskaTag {
223223 impl_accessor ! (
224224 artist => ( Track , "ARTIST" ) ,
225225 title => ( Track , "TITLE" ) ,
@@ -267,21 +267,21 @@ impl Accessor for EbmlTag {
267267 }
268268}
269269
270- impl TagExt for EbmlTag {
270+ impl TagExt for MatroskaTag {
271271 type Err = LoftyError ;
272- type RefKey < ' a > = EbmlTagKey < ' a > ;
272+ type RefKey < ' a > = MatroskaTagKey < ' a > ;
273273
274274 #[ inline]
275275 fn tag_type ( & self ) -> TagType {
276- TagType :: Ebml
276+ TagType :: Matroska
277277 }
278278
279279 fn len ( & self ) -> usize {
280280 self . tags . iter ( ) . map ( Tag :: len) . sum :: < usize > ( ) + self . attached_files . len ( )
281281 }
282282
283283 fn contains < ' a > ( & ' a self , key : Self :: RefKey < ' a > ) -> bool {
284- let EbmlTagKey ( target_type, key) = key;
284+ let MatroskaTagKey ( target_type, key) = key;
285285 self . tags . iter ( ) . any ( |tag| {
286286 if let Some ( target) = & tag. target {
287287 return target. target_type == target_type
@@ -338,23 +338,23 @@ impl TagExt for EbmlTag {
338338
339339#[ doc( hidden) ]
340340#[ derive( Debug , Clone , Default ) ]
341- pub struct SplitTagRemainder ( EbmlTag ) ;
341+ pub struct SplitTagRemainder ( MatroskaTag ) ;
342342
343- impl From < SplitTagRemainder > for EbmlTag {
343+ impl From < SplitTagRemainder > for MatroskaTag {
344344 fn from ( from : SplitTagRemainder ) -> Self {
345345 from. 0
346346 }
347347}
348348
349349impl Deref for SplitTagRemainder {
350- type Target = EbmlTag ;
350+ type Target = MatroskaTag ;
351351
352352 fn deref ( & self ) -> & Self :: Target {
353353 & self . 0
354354 }
355355}
356356
357- impl SplitTag for EbmlTag {
357+ impl SplitTag for MatroskaTag {
358358 type Remainder = SplitTagRemainder ;
359359
360360 fn split_tag ( mut self ) -> ( Self :: Remainder , crate :: tag:: Tag ) {
@@ -364,20 +364,20 @@ impl SplitTag for EbmlTag {
364364}
365365
366366impl MergeTag for SplitTagRemainder {
367- type Merged = EbmlTag ;
367+ type Merged = MatroskaTag ;
368368
369369 fn merge_tag ( self , _tag : crate :: tag:: Tag ) -> Self :: Merged {
370370 todo ! ( )
371371 }
372372}
373373
374- impl From < EbmlTag > for crate :: tag:: Tag {
375- fn from ( input : EbmlTag ) -> Self {
374+ impl From < MatroskaTag > for crate :: tag:: Tag {
375+ fn from ( input : MatroskaTag ) -> Self {
376376 input. split_tag ( ) . 1
377377 }
378378}
379379
380- impl From < crate :: tag:: Tag > for EbmlTag {
380+ impl From < crate :: tag:: Tag > for MatroskaTag {
381381 fn from ( input : crate :: tag:: Tag ) -> Self {
382382 SplitTagRemainder :: default ( ) . merge_tag ( input)
383383 }
0 commit comments