caio.co/de/foca

Adjust to new clippy lints

Id
75c6bd8c31d51a044c6c7e27b5a7b5ccd11b0ea2
Author
Caio
Commit time
2024-09-05T21:07:20+02:00

Modified src/broadcast.rs

@@ -195,7 +195,7
num_taken += 1;
remaining -= 1;

- debug_assert!(node.data.len() <= core::u16::MAX as usize);
+ debug_assert!(u16::try_from(node.data.len()).is_ok());
buffer.put_u16(node.data.len() as u16);
buffer.put_slice(&node.data);
node.remaining_tx -= 1;

Modified src/config.rs

@@ -317,7 +317,7
if max_tx <= 1.0 {
NonZeroU8::new(1).unwrap()
} else if max_tx >= 255.0 {
- NonZeroU8::new(core::u8::MAX).unwrap()
+ NonZeroU8::new(u8::MAX).unwrap()
} else {
NonZeroU8::new(max_tx as u8).expect("f64 ]1,255[ as u8 is non-zero")
}

Modified src/lib.rs

@@ -85,7 +85,6
clippy::match_wild_err_arm,
clippy::match_wildcard_for_single_variants,
clippy::mem_forget,
- clippy::mismatched_target_os,
clippy::missing_enforced_import_renames,
clippy::mut_mut,
clippy::mutex_integer,

Modified src/member.rs

@@ -199,7 +199,7
// is needed, so we set it to MAX. Any other value could
// cause the shuffle to not happen since members may join
// in-between probes
- self.cursor = core::usize::MAX;
+ self.cursor = usize::MAX;
} else {
self.cursor = pos.saturating_add(1);
}