Skip to content

Commit ddc2b87

Browse files
fix: apply suggestions from 1.71 clippy beta
Pull-Request: #4009.
1 parent efb117e commit ddc2b87

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

examples/metrics/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ impl Behaviour {
134134
"/ipfs/0.1.0".into(),
135135
local_pub_key,
136136
)),
137-
keep_alive: keep_alive::Behaviour::default(),
137+
keep_alive: keep_alive::Behaviour,
138138
}
139139
}
140140
}

misc/quick-protobuf-codec/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ impl<In, Out> Codec<In, Out> {
2525
uvi.set_max_len(max_message_len_bytes);
2626
Self {
2727
uvi,
28-
phantom: PhantomData::default(),
28+
phantom: PhantomData,
2929
}
3030
}
3131
}

protocols/gossipsub/src/behaviour/tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5099,7 +5099,7 @@ fn test_msg_id_fn_only_called_once_with_fast_message_ids() {
50995099
}
51005100

51015101
let message_id_fn = |m: &Message| -> MessageId {
5102-
let (mut id, mut counters_pointer): (MessageId, *mut Pointers) =
5102+
let (mut id, counters_pointer): (MessageId, *mut Pointers) =
51035103
get_counters_and_hash!(&m.data);
51045104
unsafe {
51055105
(*counters_pointer).slow_counter += 1;
@@ -5108,7 +5108,7 @@ fn test_msg_id_fn_only_called_once_with_fast_message_ids() {
51085108
id
51095109
};
51105110
let fast_message_id_fn = |m: &RawMessage| -> FastMessageId {
5111-
let (id, mut counters_pointer) = get_counters_and_hash!(&m.data);
5111+
let (id, counters_pointer) = get_counters_and_hash!(&m.data);
51125112
unsafe {
51135113
(*counters_pointer).fast_counter += 1;
51145114
}

protocols/gossipsub/src/peer_score.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ impl PeerScore {
649649
}
650650

651651
let peers: Vec<_> = {
652-
let mut record = self
652+
let record = self
653653
.deliveries
654654
.entry(msg_id.clone())
655655
.or_insert_with(DeliveryRecord::default);

protocols/identify/tests/smoke.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ impl Behaviour {
202202
fn new(config: identify::Config) -> Self {
203203
Self {
204204
identify: identify::Behaviour::new(config),
205-
keep_alive: keep_alive::Behaviour::default(),
205+
keep_alive: keep_alive::Behaviour,
206206
}
207207
}
208208
}

transports/noise/src/io/framed.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ where
166166
type Item = io::Result<Bytes>;
167167

168168
fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
169-
let mut this = Pin::into_inner(self);
169+
let this = Pin::into_inner(self);
170170
loop {
171171
trace!("read state: {:?}", this.read_state);
172172
match this.read_state {
@@ -265,7 +265,7 @@ where
265265
type Error = io::Error;
266266

267267
fn poll_ready(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
268-
let mut this = Pin::into_inner(self);
268+
let this = Pin::into_inner(self);
269269
loop {
270270
trace!("write state {:?}", this.write_state);
271271
match this.write_state {
@@ -321,7 +321,7 @@ where
321321

322322
fn start_send(self: Pin<&mut Self>, frame: &Vec<u8>) -> Result<(), Self::Error> {
323323
assert!(frame.len() <= MAX_FRAME_LEN);
324-
let mut this = Pin::into_inner(self);
324+
let this = Pin::into_inner(self);
325325
assert!(this.write_state.is_ready());
326326

327327
this.write_buffer

0 commit comments

Comments
 (0)