Skip to content

Commit 0741576

Browse files
committed
clippy..
1 parent 7bf0ea4 commit 0741576

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

crates/core/src/commands/check.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,6 @@ impl ReadSubsetOption {
4949
self.apply_with_rng(packs, &mut thread_rng())
5050
}
5151

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)]
5652
fn apply_with_rng(
5753
self,
5854
packs: impl IntoIterator<Item = IndexPack>,
@@ -72,6 +68,10 @@ impl ReadSubsetOption {
7268
// Apply read-subset option
7369
if let Some(mut size) = match self {
7470
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)]
7575
Self::Percentage(p) => Some((total_size as f64 * p / 100.0) as u64),
7676
Self::Size(s) => Some(s),
7777
Self::IdSubSet((n, m)) => {
@@ -654,6 +654,10 @@ mod tests {
654654
#[case("5/12")]
655655
#[case("5%")]
656656
#[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)]
657661
fn test_read_subset(mut rng: StdRng, #[case] s: &str) {
658662
let size =
659663
|packs: &[IndexPack]| -> u64 { packs.iter().map(|p| u64::from(p.pack_size())).sum() };

0 commit comments

Comments
 (0)