@@ -10,7 +10,7 @@ use constriction::{
1010 BitArray , Pos , Seek ,
1111} ;
1212use criterion:: { black_box, criterion_group, Criterion } ;
13- use num :: cast :: AsPrimitive ;
13+ use num_traits :: AsPrimitive ;
1414use rand:: { RngCore , SeedableRng } ;
1515use rand_xoshiro:: Xoshiro256StarStar ;
1616
@@ -26,7 +26,7 @@ criterion_group!(
2626#[ cfg( not( miri) ) ]
2727criterion:: criterion_main!( benches) ;
2828#[ cfg( miri) ]
29- fn main ( ) { } // All benchmarks currently use FFI and therefore can't be tested in miri .
29+ fn main ( ) { } // miri currently doesn't seem to be able to run criterion benchmarks as tests .
3030
3131fn round_trip_u32_u64_u16_12 ( c : & mut Criterion ) {
3232 round_trip :: < u32 , u64 , u16 , 12 > ( c) ;
8787 type_name:: <Probability >( ) ,
8888 PRECISION
8989 ) ;
90- c. bench_function ( & format ! ( "ans_encoding_{}" , label_suffix ) , |b| {
90+ c. bench_function ( & format ! ( "ans_encoding_{label_suffix}" ) , |b| {
9191 b. iter ( || {
9292 encoder. clear ( ) ;
9393 encoder
@@ -109,7 +109,7 @@ where
109109 let mut backward_decoder = encoder. into_seekable_decoder ( ) ;
110110 let reset_snapshot = backward_decoder. pos ( ) ;
111111
112- c. bench_function ( & format ! ( "ans_backward_decoding_{}" , label_suffix ) , |b| {
112+ c. bench_function ( & format ! ( "ans_backward_decoding_{label_suffix}" ) , |b| {
113113 b. iter ( || {
114114 backward_decoder. seek ( black_box ( reset_snapshot) ) . unwrap ( ) ;
115115 let mut checksum = 1234u16 ;
@@ -132,7 +132,7 @@ where
132132 let mut forward_decoder = backward_decoder. into_reversed ( ) ;
133133 let reset_snapshot = forward_decoder. pos ( ) ;
134134
135- c. bench_function ( & format ! ( "ans_forward_decoding_{}" , label_suffix ) , |b| {
135+ c. bench_function ( & format ! ( "ans_forward_decoding_{label_suffix}" ) , |b| {
136136 b. iter ( || {
137137 forward_decoder. seek ( black_box ( reset_snapshot) ) . unwrap ( ) ;
138138 let mut checksum = 1234u16 ;
@@ -179,7 +179,7 @@ where
179179 type_name:: <Probability >( ) ,
180180 PRECISION
181181 ) ;
182- c. bench_function ( & format ! ( "range_encoding_{}" , label_suffix ) , |b| {
182+ c. bench_function ( & format ! ( "range_encoding_{label_suffix}" ) , |b| {
183183 b. iter ( || {
184184 encoder. clear ( ) ;
185185 encoder
@@ -200,7 +200,7 @@ where
200200
201201 let mut decoder = encoder. into_decoder ( ) . unwrap ( ) ;
202202
203- c. bench_function ( & format ! ( "range_decoding_{}" , label_suffix ) , |b| {
203+ c. bench_function ( & format ! ( "range_decoding_{label_suffix}" ) , |b| {
204204 b. iter ( || {
205205 decoder. seek ( black_box ( reset_snapshot) ) . unwrap ( ) ;
206206 let mut checksum = 1234u16 ;
0 commit comments