@@ -13,7 +13,7 @@ use lofty::tag::{Accessor, TagExt};
1313
1414use std:: borrow:: Cow ;
1515
16- use iai_callgrind :: { library_benchmark, library_benchmark_group, main} ;
16+ use gungraun :: { library_benchmark, library_benchmark_group, main} ;
1717
1818const ENCODER : & str = "Lavf57.56.101" ;
1919
@@ -44,12 +44,10 @@ bench_tag_write!([
4444 use lofty:: ape:: ApeItem ;
4545 use lofty:: tag:: ItemValue ;
4646
47- let picture = Picture :: new_unchecked(
48- PictureType :: CoverFront ,
49- Some ( MimeType :: Jpeg ) ,
50- None ,
51- include_bytes!( "./assets/cover.jpg" ) . to_vec( ) ,
52- ) ;
47+ let picture = Picture :: unchecked( include_bytes!( "./assets/cover.jpg" ) . to_vec( ) )
48+ . pic_type( PictureType :: CoverFront )
49+ . mime_type( MimeType :: Jpeg )
50+ . build( ) ;
5351
5452 tag. insert(
5553 ApeItem :: new(
@@ -70,12 +68,10 @@ bench_tag_write!([
7068 use lofty:: TextEncoding ;
7169 use lofty:: id3:: v2:: { Frame , TextInformationFrame } ;
7270
73- let picture = Picture :: new_unchecked(
74- PictureType :: CoverFront ,
75- Some ( MimeType :: Jpeg ) ,
76- None ,
77- include_bytes!( "./assets/cover.jpg" ) . to_vec( ) ,
78- ) ;
71+ let picture = Picture :: unchecked( include_bytes!( "./assets/cover.jpg" ) . to_vec( ) )
72+ . pic_type( PictureType :: CoverFront )
73+ . mime_type( MimeType :: Jpeg )
74+ . build( ) ;
7975
8076 tag. insert_picture( picture) ;
8177 tag. insert( Frame :: Text ( TextInformationFrame :: new(
@@ -88,12 +84,10 @@ bench_tag_write!([
8884 ( ilst, Ilst , |tag| {
8985 use lofty:: mp4:: { Atom , AtomData , AtomIdent } ;
9086
91- let picture = Picture :: new_unchecked(
92- PictureType :: CoverFront ,
93- Some ( MimeType :: Jpeg ) ,
94- None ,
95- include_bytes!( "./assets/cover.jpg" ) . to_vec( ) ,
96- ) ;
87+ let picture = Picture :: unchecked( include_bytes!( "./assets/cover.jpg" ) . to_vec( ) )
88+ . pic_type( PictureType :: CoverFront )
89+ . mime_type( MimeType :: Jpeg )
90+ . build( ) ;
9791
9892 tag. insert_picture( picture) ;
9993 tag. insert( Atom :: new(
@@ -107,12 +101,10 @@ bench_tag_write!([
107101 ( vorbis_comments, VorbisComments , |tag| {
108102 use lofty:: ogg:: OggPictureStorage ;
109103
110- let picture = Picture :: new_unchecked(
111- PictureType :: CoverFront ,
112- Some ( MimeType :: Jpeg ) ,
113- None ,
114- include_bytes!( "./assets/cover.jpg" ) . to_vec( ) ,
115- ) ;
104+ let picture = Picture :: unchecked( include_bytes!( "./assets/cover.jpg" ) . to_vec( ) )
105+ . pic_type( PictureType :: CoverFront )
106+ . mime_type( MimeType :: Jpeg )
107+ . build( ) ;
116108
117109 let _ = tag. insert_picture( picture, None ) . unwrap( ) ;
118110 tag. push( String :: from( "ENCODER" ) , String :: from( ENCODER ) ) ;
0 commit comments