From 23cb4ebf08f4c09f33bb2d9d8ec7736a61a094b8 Mon Sep 17 00:00:00 2001 From: Phoenix Kahlo Date: Sun, 22 Dec 2024 13:54:51 -0600 Subject: [PATCH] Remove various obselete `allow` directives --- quinn-proto/src/congestion/cubic.rs | 2 -- quinn-proto/src/connection/mod.rs | 1 - quinn-proto/src/endpoint.rs | 1 - quinn-proto/src/frame.rs | 1 - quinn-proto/src/tests/mod.rs | 1 - quinn/src/connection.rs | 3 +-- quinn/src/endpoint.rs | 3 +-- quinn/tests/many_connections.rs | 1 - 8 files changed, 2 insertions(+), 11 deletions(-) diff --git a/quinn-proto/src/congestion/cubic.rs b/quinn-proto/src/congestion/cubic.rs index e29a2c24d..94c3b52ff 100644 --- a/quinn-proto/src/congestion/cubic.rs +++ b/quinn-proto/src/congestion/cubic.rs @@ -180,8 +180,6 @@ impl Controller for Cubic { self.recovery_start_time = Some(now); // Fast convergence - #[allow(clippy::branches_sharing_code)] - // https://github.com/rust-lang/rust-clippy/issues/7198 if (self.window as f64) < self.cubic_state.w_max { self.cubic_state.w_max = self.window as f64 * (1.0 + BETA_CUBIC) / 2.0; } else { diff --git a/quinn-proto/src/connection/mod.rs b/quinn-proto/src/connection/mod.rs index 98045bfd3..978a34e85 100644 --- a/quinn-proto/src/connection/mod.rs +++ b/quinn-proto/src/connection/mod.rs @@ -1763,7 +1763,6 @@ impl Connection { result } - #[allow(clippy::suspicious_operation_groupings)] fn peer_completed_address_validation(&self) -> bool { if self.side.is_server() || self.state.is_closed() { return true; diff --git a/quinn-proto/src/endpoint.rs b/quinn-proto/src/endpoint.rs index 2633f8e21..039a35733 100644 --- a/quinn-proto/src/endpoint.rs +++ b/quinn-proto/src/endpoint.rs @@ -1155,7 +1155,6 @@ impl IndexMut for Slab { } /// Event resulting from processing a single datagram -#[allow(clippy::large_enum_variant)] // Not passed around extensively pub enum DatagramEvent { /// The datagram is redirected to its `Connection` ConnectionEvent(ConnectionHandle, ConnectionEvent), diff --git a/quinn-proto/src/frame.rs b/quinn-proto/src/frame.rs index 5d23f7675..33bd7b6d7 100644 --- a/quinn-proto/src/frame.rs +++ b/quinn-proto/src/frame.rs @@ -943,7 +943,6 @@ mod test { } #[test] - #[allow(clippy::range_plus_one)] fn ack_coding() { const PACKETS: &[u64] = &[1, 2, 3, 5, 10, 11, 14]; let mut ranges = ArrayRangeSet::new(); diff --git a/quinn-proto/src/tests/mod.rs b/quinn-proto/src/tests/mod.rs index 2cf66f4cf..ac254d555 100644 --- a/quinn-proto/src/tests/mod.rs +++ b/quinn-proto/src/tests/mod.rs @@ -537,7 +537,6 @@ fn congestion() { pair.client_send(client_ch, s).write(&[42; 1024]).unwrap(); } -#[allow(clippy::field_reassign_with_default)] // https://github.com/rust-lang/rust-clippy/issues/6527 #[test] fn high_latency_handshake() { let _guard = subscribe(); diff --git a/quinn/src/connection.rs b/quinn/src/connection.rs index 8fdef83e5..e08a4fdc0 100644 --- a/quinn/src/connection.rs +++ b/quinn/src/connection.rs @@ -239,8 +239,7 @@ struct ConnectionDriver(ConnectionRef); impl Future for ConnectionDriver { type Output = Result<(), io::Error>; - #[allow(unused_mut)] // MSRV - fn poll(mut self: Pin<&mut Self>, cx: &mut Context) -> Poll { + fn poll(self: Pin<&mut Self>, cx: &mut Context) -> Poll { let conn = &mut *self.0.state.lock("poll"); let span = debug_span!("drive", id = conn.handle.0); diff --git a/quinn/src/endpoint.rs b/quinn/src/endpoint.rs index 4f5cc3db3..509d5abd6 100644 --- a/quinn/src/endpoint.rs +++ b/quinn/src/endpoint.rs @@ -357,8 +357,7 @@ pub(crate) struct EndpointDriver(pub(crate) EndpointRef); impl Future for EndpointDriver { type Output = Result<(), io::Error>; - #[allow(unused_mut)] // MSRV - fn poll(mut self: Pin<&mut Self>, cx: &mut Context) -> Poll { + fn poll(self: Pin<&mut Self>, cx: &mut Context) -> Poll { let mut endpoint = self.0.state.lock().unwrap(); if endpoint.driver.is_none() { endpoint.driver = Some(cx.waker().clone()); diff --git a/quinn/tests/many_connections.rs b/quinn/tests/many_connections.rs index 5083487a6..77f58a666 100644 --- a/quinn/tests/many_connections.rs +++ b/quinn/tests/many_connections.rs @@ -182,7 +182,6 @@ fn hash_correct(data: &[u8], crc: &Crc) -> bool { encoded_hash == actual_hash } -#[allow(unsafe_code)] fn random_vec(size: usize) -> Vec { let mut ret = vec![0; size]; rand::thread_rng().fill_bytes(&mut ret[..]);