diff --git a/examples/metrics/src/main.rs b/examples/metrics/src/main.rs index 2178de98..4dede131 100644 --- a/examples/metrics/src/main.rs +++ b/examples/metrics/src/main.rs @@ -134,7 +134,7 @@ impl Behaviour { "/ipfs/0.1.0".into(), local_pub_key, )), - keep_alive: keep_alive::Behaviour::default(), + keep_alive: keep_alive::Behaviour, } } } diff --git a/misc/quick-protobuf-codec/src/lib.rs b/misc/quick-protobuf-codec/src/lib.rs index 54785fbe..04ee4980 100644 --- a/misc/quick-protobuf-codec/src/lib.rs +++ b/misc/quick-protobuf-codec/src/lib.rs @@ -25,7 +25,7 @@ impl Codec { uvi.set_max_len(max_message_len_bytes); Self { uvi, - phantom: PhantomData::default(), + phantom: PhantomData, } } } diff --git a/protocols/gossipsub/src/behaviour/tests.rs b/protocols/gossipsub/src/behaviour/tests.rs index 29262e9c..37f25631 100644 --- a/protocols/gossipsub/src/behaviour/tests.rs +++ b/protocols/gossipsub/src/behaviour/tests.rs @@ -5099,7 +5099,7 @@ fn test_msg_id_fn_only_called_once_with_fast_message_ids() { } let message_id_fn = |m: &Message| -> MessageId { - let (mut id, mut counters_pointer): (MessageId, *mut Pointers) = + let (mut id, counters_pointer): (MessageId, *mut Pointers) = get_counters_and_hash!(&m.data); unsafe { (*counters_pointer).slow_counter += 1; @@ -5108,7 +5108,7 @@ fn test_msg_id_fn_only_called_once_with_fast_message_ids() { id }; let fast_message_id_fn = |m: &RawMessage| -> FastMessageId { - let (id, mut counters_pointer) = get_counters_and_hash!(&m.data); + let (id, counters_pointer) = get_counters_and_hash!(&m.data); unsafe { (*counters_pointer).fast_counter += 1; } diff --git a/protocols/gossipsub/src/peer_score.rs b/protocols/gossipsub/src/peer_score.rs index 10f56994..83f5a68e 100644 --- a/protocols/gossipsub/src/peer_score.rs +++ b/protocols/gossipsub/src/peer_score.rs @@ -649,7 +649,7 @@ impl PeerScore { } let peers: Vec<_> = { - let mut record = self + let record = self .deliveries .entry(msg_id.clone()) .or_insert_with(DeliveryRecord::default); diff --git a/protocols/identify/tests/smoke.rs b/protocols/identify/tests/smoke.rs index 5aff98f9..2cf7cc89 100644 --- a/protocols/identify/tests/smoke.rs +++ b/protocols/identify/tests/smoke.rs @@ -202,7 +202,7 @@ impl Behaviour { fn new(config: identify::Config) -> Self { Self { identify: identify::Behaviour::new(config), - keep_alive: keep_alive::Behaviour::default(), + keep_alive: keep_alive::Behaviour, } } } diff --git a/transports/noise/src/io/framed.rs b/transports/noise/src/io/framed.rs index 0904c024..8c1a49fc 100644 --- a/transports/noise/src/io/framed.rs +++ b/transports/noise/src/io/framed.rs @@ -166,7 +166,7 @@ where type Item = io::Result; fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { - let mut this = Pin::into_inner(self); + let this = Pin::into_inner(self); loop { trace!("read state: {:?}", this.read_state); match this.read_state { @@ -265,7 +265,7 @@ where type Error = io::Error; fn poll_ready(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { - let mut this = Pin::into_inner(self); + let this = Pin::into_inner(self); loop { trace!("write state {:?}", this.write_state); match this.write_state { @@ -321,7 +321,7 @@ where fn start_send(self: Pin<&mut Self>, frame: &Vec) -> Result<(), Self::Error> { assert!(frame.len() <= MAX_FRAME_LEN); - let mut this = Pin::into_inner(self); + let this = Pin::into_inner(self); assert!(this.write_state.is_ready()); this.write_buffer