Skip to content

Commit 7e0edae

Browse files
committed
feat(p2p/meshsub): fix clippy warnings
1 parent b04ec0b commit 7e0edae

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

p2p/src/network/pubsub/p2p_network_pubsub_reducer.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,11 @@ impl P2pNetworkPubsubState {
8888
let topic = self.topics.entry(topic_id).or_default();
8989

9090
if subscription.subscribe() {
91-
if let Entry::Vacant(v) = topic.entry(peer_id.clone()) {
91+
if let Entry::Vacant(v) = topic.entry(*peer_id) {
9292
v.insert(P2pNetworkPubsubClientTopicState::default());
9393
}
9494
} else {
95-
topic.remove(&peer_id);
95+
topic.remove(peer_id);
9696
}
9797
}
9898
for message in v.publish {
@@ -170,7 +170,7 @@ impl P2pNetworkPubsubState {
170170
if let Some(mesh_state) = self
171171
.topics
172172
.get_mut(dbg!(graft.topic_id()))
173-
.and_then(|m| m.get_mut(&peer_id))
173+
.and_then(|m| m.get_mut(peer_id))
174174
{
175175
mesh_state.mesh = P2pNetworkPubsubClientMeshAddingState::Added;
176176
}
@@ -179,7 +179,7 @@ impl P2pNetworkPubsubState {
179179
if let Some(mesh_state) = self
180180
.topics
181181
.get_mut(prune.topic_id())
182-
.and_then(|m| m.get_mut(&peer_id))
182+
.and_then(|m| m.get_mut(peer_id))
183183
{
184184
mesh_state.mesh =
185185
P2pNetworkPubsubClientMeshAddingState::TheyRefused;

0 commit comments

Comments
 (0)