Use expect instead of allow; Clean up lints
- Id
- b51790bc1126557f5fa5f4a4081f3e480df13468
- Author
- Caio
- Commit time
- 2026-04-26T07:42:47+02:00
Modified src/broadcast.rs
}
}
-#[allow(dead_code)]
pub(crate) struct Broadcasts<V> {
flip: alloc::collections::BinaryHeap<Entry<V>>,
flop: alloc::collections::BinaryHeap<Entry<V>>,
Modified src/error.rs
impl PartialEq for Error {
fn eq(&self, other: &Self) -> bool {
use alloc::string::ToString;
- #[allow(clippy::match_same_arms)]
+ #[expect(clippy::match_same_arms)]
match (self, other) {
// Wrapped errors have to allocate to compare :(
// But PartialEq on an error type is mostly useful for tests
impl fmt::Display for Error {
fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
- #[allow(clippy::match_same_arms)]
+ #[expect(clippy::match_same_arms)]
match self {
Self::DataTooBig => {
formatter.write_str("Received data larger than maximum configured limit")
Modified src/lib.rs
Ok(())
}
Timer::RemoveDown(down) => {
- #[cfg_attr(
- not(feature = "tracing"),
- allow(unused_variables, clippy::if_same_then_else)
- )]
if let Some(_removed) = self.members.remove_if_down(&down) {
#[cfg(feature = "tracing")]
tracing::trace!(down = tracing::field::debug(&down), "Member removed");
self.send_message(src, Message::Ack(probe_number), runtime)?;
}
Message::Ack(probe_number) => {
- #[cfg_attr(not(feature = "tracing"), allow(clippy::if_same_then_else))]
if self.probe.receive_ack(&src, probe_number) {
#[cfg(feature = "tracing")]
tracing::debug!(probed_id = tracing::field::debug(&src), "Probe success");
.apply_existing_if(as_suspect.clone(), |_member| true)
{
let is_active_now = summary.is_active_now;
- #[cfg_attr(not(feature = "tracing"), allow(unused_variables))]
+ #[cfg_attr(not(feature = "tracing"), expect(unused_variables))]
let apply_successful = summary.apply_successful;
self.handle_apply_summary(summary, as_suspect, true, &mut runtime)?;
if add_custom_broadcast {
// Fill the remaining space in the buffer with custom
// broadcasts, if any
- #[cfg_attr(not(feature = "tracing"), allow(unused_variables))]
+ #[cfg_attr(not(feature = "tracing"), expect(unused_variables))]
let num_broadcasts = self
.custom_broadcasts
.fill_with_len_prefix(&mut buf, usize::MAX);