@@ -49,10 +49,6 @@ impl ReadSubsetOption {
49
49
self . apply_with_rng ( packs, & mut thread_rng ( ) )
50
50
}
51
51
52
- // we need some casts to compute percentage...
53
- #[ allow( clippy:: cast_possible_truncation) ]
54
- #[ allow( clippy:: cast_precision_loss) ]
55
- #[ allow( clippy:: cast_sign_loss) ]
56
52
fn apply_with_rng (
57
53
self ,
58
54
packs : impl IntoIterator < Item = IndexPack > ,
@@ -72,6 +68,10 @@ impl ReadSubsetOption {
72
68
// Apply read-subset option
73
69
if let Some ( mut size) = match self {
74
70
Self :: All => None ,
71
+ // we need some casts to compute percentage...
72
+ #[ allow( clippy:: cast_possible_truncation) ]
73
+ #[ allow( clippy:: cast_precision_loss) ]
74
+ #[ allow( clippy:: cast_sign_loss) ]
75
75
Self :: Percentage ( p) => Some ( ( total_size as f64 * p / 100.0 ) as u64 ) ,
76
76
Self :: Size ( s) => Some ( s) ,
77
77
Self :: IdSubSet ( ( n, m) ) => {
@@ -654,6 +654,10 @@ mod tests {
654
654
#[ case( "5/12" ) ]
655
655
#[ case( "5%" ) ]
656
656
#[ case( "250MiB" ) ]
657
+ // we need some casts to compute percentage...
658
+ #[ allow( clippy:: cast_possible_truncation) ]
659
+ #[ allow( clippy:: cast_precision_loss) ]
660
+ #[ allow( clippy:: cast_sign_loss) ]
657
661
fn test_read_subset ( mut rng : StdRng , #[ case] s : & str ) {
658
662
let size =
659
663
|packs : & [ IndexPack ] | -> u64 { packs. iter ( ) . map ( |p| u64:: from ( p. pack_size ( ) ) ) . sum ( ) } ;
0 commit comments